diff options
Diffstat (limited to 'Modules/Platform/Android-Determine.cmake')
-rw-r--r-- | Modules/Platform/Android-Determine.cmake | 71 |
1 files changed, 47 insertions, 24 deletions
diff --git a/Modules/Platform/Android-Determine.cmake b/Modules/Platform/Android-Determine.cmake index bc66ba1..77e621a 100644 --- a/Modules/Platform/Android-Determine.cmake +++ b/Modules/Platform/Android-Determine.cmake @@ -5,6 +5,12 @@ # This module detects platform-wide information about the Android target # in order to store it in "CMakeSystem.cmake". +# Include the NDK hook. +# It can be used by NDK to inject necessary fixes for an earlier cmake. +if(CMAKE_ANDROID_NDK) + include(${CMAKE_ANDROID_NDK}/build/cmake/hooks/pre/Android-Determine.cmake OPTIONAL) +endif() + # Support for NVIDIA Nsight Tegra Visual Studio Edition was previously # implemented in the CMake VS IDE generators. Avoid interfering with # that functionality for now. @@ -252,30 +258,38 @@ endif() # https://developer.android.com/ndk/guides/abis.html -set(_ANDROID_ABI_arm64-v8a_PROC "aarch64") -set(_ANDROID_ABI_arm64-v8a_ARCH "arm64") -set(_ANDROID_ABI_arm64-v8a_TRIPLE "aarch64-linux-android") -set(_ANDROID_ABI_armeabi-v7a_PROC "armv7-a") -set(_ANDROID_ABI_armeabi-v7a_ARCH "arm") -set(_ANDROID_ABI_armeabi-v7a_TRIPLE "arm-linux-androideabi") -set(_ANDROID_ABI_armeabi-v6_PROC "armv6") -set(_ANDROID_ABI_armeabi-v6_ARCH "arm") -set(_ANDROID_ABI_armeabi-v6_TRIPLE "arm-linux-androideabi") -set(_ANDROID_ABI_armeabi_PROC "armv5te") -set(_ANDROID_ABI_armeabi_ARCH "arm") -set(_ANDROID_ABI_armeabi_TRIPLE "arm-linux-androideabi") -set(_ANDROID_ABI_mips_PROC "mips") -set(_ANDROID_ABI_mips_ARCH "mips") -set(_ANDROID_ABI_mips_TRIPLE "mipsel-linux-android") -set(_ANDROID_ABI_mips64_PROC "mips64") -set(_ANDROID_ABI_mips64_ARCH "mips64") -set(_ANDROID_ABI_mips64_TRIPLE "mips64el-linux-android") -set(_ANDROID_ABI_x86_PROC "i686") -set(_ANDROID_ABI_x86_ARCH "x86") -set(_ANDROID_ABI_x86_TRIPLE "i686-linux-android") -set(_ANDROID_ABI_x86_64_PROC "x86_64") -set(_ANDROID_ABI_x86_64_ARCH "x86_64") -set(_ANDROID_ABI_x86_64_TRIPLE "x86_64-linux-android") +set(_ANDROID_ABI_arm64-v8a_PROC "aarch64") +set(_ANDROID_ABI_arm64-v8a_ARCH "arm64") +set(_ANDROID_ABI_arm64-v8a_TRIPLE "aarch64-linux-android") +set(_ANDROID_ABI_arm64-v8a_LLVM_TRIPLE "aarch64-none-linux-android") +set(_ANDROID_ABI_armeabi-v7a_PROC "armv7-a") +set(_ANDROID_ABI_armeabi-v7a_ARCH "arm") +set(_ANDROID_ABI_armeabi-v7a_TRIPLE "arm-linux-androideabi") +set(_ANDROID_ABI_armeabi-v7a_LLVM_TRIPLE "armv7-none-linux-androideabi") +set(_ANDROID_ABI_armeabi-v6_PROC "armv6") +set(_ANDROID_ABI_armeabi-v6_ARCH "arm") +set(_ANDROID_ABI_armeabi-v6_TRIPLE "arm-linux-androideabi") +set(_ANDROID_ABI_armeabi-v6_LLVM_TRIPLE "armv6-none-linux-androideabi") +set(_ANDROID_ABI_armeabi_PROC "armv5te") +set(_ANDROID_ABI_armeabi_ARCH "arm") +set(_ANDROID_ABI_armeabi_TRIPLE "arm-linux-androideabi") +set(_ANDROID_ABI_armeabi_LLVM_TRIPLE "armv5te-none-linux-androideabi") +set(_ANDROID_ABI_mips_PROC "mips") +set(_ANDROID_ABI_mips_ARCH "mips") +set(_ANDROID_ABI_mips_TRIPLE "mipsel-linux-android") +set(_ANDROID_ABI_mips_LLVM_TRIPLE "mipsel-none-linux-android") +set(_ANDROID_ABI_mips64_PROC "mips64") +set(_ANDROID_ABI_mips64_ARCH "mips64") +set(_ANDROID_ABI_mips64_TRIPLE "mips64el-linux-android") +set(_ANDROID_ABI_mips64_LLVM_TRIPLE "mips64el-none-linux-android") +set(_ANDROID_ABI_x86_PROC "i686") +set(_ANDROID_ABI_x86_ARCH "x86") +set(_ANDROID_ABI_x86_TRIPLE "i686-linux-android") +set(_ANDROID_ABI_x86_LLVM_TRIPLE "i686-none-linux-android") +set(_ANDROID_ABI_x86_64_PROC "x86_64") +set(_ANDROID_ABI_x86_64_ARCH "x86_64") +set(_ANDROID_ABI_x86_64_TRIPLE "x86_64-linux-android") +set(_ANDROID_ABI_x86_64_LLVM_TRIPLE "x86_64-none-linux-android") set(_ANDROID_PROC_aarch64_ARCH_ABI "arm64-v8a") set(_ANDROID_PROC_armv7-a_ARCH_ABI "armeabi-v7a") @@ -377,6 +391,8 @@ if(_ANDROID_SYSROOT_ARCH AND NOT "x${_ANDROID_SYSROOT_ARCH}" STREQUAL "x${CMAKE_ ) endif() set(CMAKE_ANDROID_ARCH_TRIPLE "${_ANDROID_ABI_${CMAKE_ANDROID_ARCH_ABI}_TRIPLE}") +set(CMAKE_ANDROID_ARCH_LLVM_TRIPLE + "${_ANDROID_ABI_${CMAKE_ANDROID_ARCH_ABI}_LLVM_TRIPLE}") # Select a processor. if(NOT CMAKE_SYSTEM_PROCESSOR) @@ -491,6 +507,7 @@ set(CMAKE_ANDROID_ARCH_ABI \"${CMAKE_ANDROID_ARCH_ABI}\") if(CMAKE_ANDROID_NDK) string(APPEND CMAKE_SYSTEM_CUSTOM_CODE "set(CMAKE_ANDROID_ARCH_TRIPLE \"${CMAKE_ANDROID_ARCH_TRIPLE}\")\n" + "set(CMAKE_ANDROID_ARCH_LLVM_TRIPLE \"${CMAKE_ANDROID_ARCH_LLVM_TRIPLE}\")\n" "set(CMAKE_ANDROID_NDK_DEPRECATED_HEADERS \"${CMAKE_ANDROID_NDK_DEPRECATED_HEADERS}\")\n" "set(CMAKE_ANDROID_NDK_TOOLCHAIN_HOST_TAG \"${CMAKE_ANDROID_NDK_TOOLCHAIN_HOST_TAG}\")\n" "set(CMAKE_ANDROID_NDK_TOOLCHAIN_UNIFIED \"${CMAKE_ANDROID_NDK_TOOLCHAIN_UNIFIED}\")\n" @@ -528,3 +545,9 @@ endif() message(STATUS "Android: Targeting API '${CMAKE_SYSTEM_VERSION}' with architecture '${CMAKE_ANDROID_ARCH}', ABI '${CMAKE_ANDROID_ARCH_ABI}', and processor '${CMAKE_SYSTEM_PROCESSOR}'") cmake_policy(POP) + +# Include the NDK hook. +# It can be used by NDK to inject necessary fixes for an earlier cmake. +if(CMAKE_ANDROID_NDK) + include(${CMAKE_ANDROID_NDK}/build/cmake/hooks/post/Android-Determine.cmake OPTIONAL) +endif() |