blob: 9383d049268832da64d0af1446259462c2532ce9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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}")
|