Skip to content

Commit

Permalink
Make android compile with modern NDK (r16b)
Browse files Browse the repository at this point in the history
Signed-off-by: Tom Hughes <[email protected]>
  • Loading branch information
thughes committed Apr 6, 2018
1 parent 90a8f08 commit 8c9d1a6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ if(ANDROID_PLATFORM)

#TODO: Fine tune pic and pie flag for executable, share library and static library.
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --sysroot=${NDK_SYSROOT_PATH} -pie")
string(APPEND CMAKE_C_FLAGS " -isysroot ${NDK_ISYSROOT_PATH}")
add_definitions(-D__ANDROID_API__=${ANDROID_API_LEVEL})

# Adding cflags for armv7. Aarch64 does not need such flags.
if(${NE10_TARGET_ARCH} STREQUAL "armv7")
Expand Down
1 change: 1 addition & 0 deletions android/android_config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ if(DEFINED ENV{ANDROID_NDK})

#NDK_SYSROOT_PATH is used in compiler's '--sysroot' flags
set(NDK_SYSROOT_PATH "$ENV{ANDROID_NDK}/platforms/android-${ANDROID_API_LEVEL}/arch-${ANDROID_NDK_PLATFORMS_ARCH_SUFFIX}/")
set(NDK_ISYSROOT_PATH "$ENV{ANDROID_NDK}/sysroot -I$ENV{ANDROID_NDK}/sysroot/usr/include/${ANDROID_NDK_TOOLCHAIN_CROSS_PREFIX}")

if(APPLE)
#TODO: Check whether this path is correct for aarch64 under mac.
Expand Down

0 comments on commit 8c9d1a6

Please sign in to comment.