aboutsummaryrefslogtreecommitdiffstats
path: root/config/config.android
diff options
context:
space:
mode:
authorAngelo Mantellini (manangel) <angelo.mantellini@irt-systemx.fr>2017-03-29 18:00:06 +0200
committerAngelo Mantellini (manangel) <angelo.mantellini@irt-systemx.fr>2017-03-30 18:58:33 +0200
commit3137acdd5a45285dab9903f9d41560c63eca8523 (patch)
tree38bd8525a9e214d848a73fc40e81ddb182cf91b6 /config/config.android
parent9b30fc10fb1cbebe651e5a107e8ca5b24de54675 (diff)
first commit
Change-Id: I8412b8e7d966c2fbc508b537fd9a9bbcfc628ca8 Signed-off-by: Angelo Mantellini (manangel) <angelo.mantellini@irt-systemx.fr>
Diffstat (limited to 'config/config.android')
-rw-r--r--config/config.android34
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}")