diff options
Diffstat (limited to 'config/config.android')
-rw-r--r-- | config/config.android | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/config/config.android b/config/config.android new file mode 100644 index 00000000..9383d049 --- /dev/null +++ b/config/config.android @@ -0,0 +1,34 @@ +# +# These are the CMAKE settings for an Android cross-compile. You need to +# update them with your toolchain paths and versions. +# +# To enable these settings being passed to the build, add the following line +# in your Distillery config file (e.g. ~/.ccnx/distillery/config.mk) +# CNX_COMPILE_ENVIRONMENT =-DCMAKE_TOOLCHAIN_FILE=~/Dev/CCNx_Distillery/config/config.android +# +# + +set(ANDROID_NDK_VERSION "android-ndk-r13b") +set(ANDROID_API_VERSION "android-23") +set(ANDROID_TOOLCHAIN "arm-linux-androideabi") +set(ANDROID_TOOLCHAIN_VERSION "${ANDROID_TOOLCHAIN}-4.9") +set(ANDROID_API "${ANDROID_API_VERSION}") +set(ANDROID_SDK "$ENV{SDK}") +set(ANDROID_NDK "$ENV{NDK}") +set(ANDROID_NDK_ROOT "${ANDROID_NDK}") + +set(TOOLCHAIN_VERSION_ROOT "${ANDROID_NDK}/toolchains/${ANDROID_TOOLCHAIN_VERSION}") +set(TOOLCHAIN_BIN "${TOOLCHAIN_VERSION_ROOT}/prebuilt/$ENV{OS}-$ENV{ARCH}/bin") + +set(SYSROOT "${ANDROID_NDK}/platforms/${ANDROID_API_VERSION}/arch-arm/") + +set(CMAKE_SYSTEM_NAME Android) +set(CMAKE_SYSROOT "${ANDROID_NDK}/platforms/${ANDROID_API_VERSION}/arch-arm/") +set(CMAKE_C_COMPILER "${TOOLCHAIN_BIN}/${ANDROID_TOOLCHAIN}-gcc") +set(CMAKE_RANLIB "${TOOLCHAIN_BIN}/${ANDROID_TOOLCHAIN}-ranlib") + +set(ANDROID_C_FLAGS "--sysroot=${SYSROOT} -Wall -D_ANDROID_ -D_$ENV{ANDROID_API_VERSION}_") + +set(CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS} "--sysroot=${SYSROOT}") +set(CMAKE_MODULE_LINKER_FLAGS ${CMAKE_MODULE_LINKER_FLAGS} "--sysroot=${SYSROOT}") +set(CMAKE_SHARED_LINKER_FLAGS ${CMAKE_SHARED_LINKER_FLAGS} "--sysroot=${SYSROOT}") |