summaryrefslogtreecommitdiff
path: root/Modules/Platform/Android/abi-armeabi-v7a-Clang.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-06-02 15:11:42 -0400
committerBrad King <brad.king@kitware.com>2016-08-23 12:51:58 -0400
commitb22294bc41c3ce62e561c7123c3f489a750dcb66 (patch)
treee4d69ae3c1d70330ca09ef9ea80fc0433cc8af2b /Modules/Platform/Android/abi-armeabi-v7a-Clang.cmake
parentb6a3102a9f8da05b50d4f4e96dd9f42ace37aa9b (diff)
downloadcmake-b22294bc41c3ce62e561c7123c3f489a750dcb66.tar.gz
Android: Populate compiler flags for current ABI
Initialize the CMAKE_{C,CXX}_FLAGS{,_<CONFIG>} cache entries with flags for each ABI as specified by NDK toolchain `setup.mk` files.
Diffstat (limited to 'Modules/Platform/Android/abi-armeabi-v7a-Clang.cmake')
-rw-r--r--Modules/Platform/Android/abi-armeabi-v7a-Clang.cmake26
1 files changed, 26 insertions, 0 deletions
diff --git a/Modules/Platform/Android/abi-armeabi-v7a-Clang.cmake b/Modules/Platform/Android/abi-armeabi-v7a-Clang.cmake
index e7c311cbb0..3a3efb3269 100644
--- a/Modules/Platform/Android/abi-armeabi-v7a-Clang.cmake
+++ b/Modules/Platform/Android/abi-armeabi-v7a-Clang.cmake
@@ -1,3 +1,29 @@
# <ndk>/build/core/toolchains/arm-linux-androideabi-clang/setup.mk
set(_ANDROID_ABI_CLANG_TARGET "armv7-none-linux-androideabi")
+
+string(APPEND _ANDROID_ABI_INIT_CFLAGS
+ " -march=armv7-a"
+ )
+
+if(CMAKE_ANDROID_ARM_MODE)
+ string(APPEND _ANDROID_ABI_INIT_CFLAGS " -marm")
+else()
+ string(APPEND _ANDROID_ABI_INIT_CFLAGS " -mthumb")
+endif()
+
+if(CMAKE_ANDROID_ARM_NEON)
+ string(APPEND _ANDROID_ABI_INIT_CFLAGS " -mfpu=neon")
+else()
+ string(APPEND _ANDROID_ABI_INIT_CFLAGS " -mfpu=vfpv3-d16")
+endif()
+
+string(APPEND _ANDROID_ABI_INIT_LDFLAGS
+ " -Wl,--fix-cortex-a8"
+ )
+
+string(APPEND _ANDROID_ABI_INIT_CFLAGS
+ " -mfloat-abi=softfp"
+ " -fpic"
+ )
+
include(Platform/Android/abi-common-Clang)