Skip to content
Permalink
Browse files

Make android compile with modern NDK (r16b)

Signed-off-by: Tom Hughes <tomtheengineer@gmail.com>
  • Loading branch information...
thughes committed Apr 6, 2018
1 parent 90a8f08 commit 8c9d1a678baf2c51964a3974bdf5148bd8289b58
Showing with 3 additions and 0 deletions.
  1. +2 −0 CMakeLists.txt
  2. +1 −0 android/android_config.cmake
@@ -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")
@@ -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.

0 comments on commit 8c9d1a6

Please sign in to comment.
You can’t perform that action at this time.