From 85e5139abac3c3fc1aba2d796a4020e0a6e95115 Mon Sep 17 00:00:00 2001 From: Haibo Huang Date: Wed, 28 Oct 2020 12:15:10 -0700 Subject: Android: Move *_LLVM_TRIPLE to the centralized table This allows us to skip `abi-*.cmake` in the next change. In the future we may move all this information to the NDK. --- Modules/Platform/Android-Clang.cmake | 2 +- Modules/Platform/Android-Determine.cmake | 59 +++++++++++++--------- Modules/Platform/Android/abi-arm64-v8a-Clang.cmake | 3 -- Modules/Platform/Android/abi-armeabi-Clang.cmake | 3 -- .../Platform/Android/abi-armeabi-v6-Clang.cmake | 3 -- .../Platform/Android/abi-armeabi-v7a-Clang.cmake | 3 -- Modules/Platform/Android/abi-mips-Clang.cmake | 3 -- Modules/Platform/Android/abi-mips64-Clang.cmake | 3 -- Modules/Platform/Android/abi-x86-Clang.cmake | 3 -- Modules/Platform/Android/abi-x86_64-Clang.cmake | 3 -- 10 files changed, 36 insertions(+), 49 deletions(-) diff --git a/Modules/Platform/Android-Clang.cmake b/Modules/Platform/Android-Clang.cmake index 44d48cd..5c1fe87 100644 --- a/Modules/Platform/Android-Clang.cmake +++ b/Modules/Platform/Android-Clang.cmake @@ -53,7 +53,7 @@ macro(__android_compiler_clang lang) __android_compiler_common(${lang}) endif() if(NOT CMAKE_${lang}_COMPILER_TARGET) - set(CMAKE_${lang}_COMPILER_TARGET "${_ANDROID_ABI_CLANG_TARGET}") + set(CMAKE_${lang}_COMPILER_TARGET "${CMAKE_ANDROID_ARCH_LLVM_TRIPLE}") if(CMAKE_ANDROID_NDK_TOOLCHAIN_UNIFIED) string(APPEND CMAKE_${lang}_COMPILER_TARGET "${CMAKE_SYSTEM_VERSION}") endif() diff --git a/Modules/Platform/Android-Determine.cmake b/Modules/Platform/Android-Determine.cmake index 3206c83..2c906ae 100644 --- a/Modules/Platform/Android-Determine.cmake +++ b/Modules/Platform/Android-Determine.cmake @@ -249,30 +249,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") @@ -374,6 +382,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) @@ -488,6 +498,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" diff --git a/Modules/Platform/Android/abi-arm64-v8a-Clang.cmake b/Modules/Platform/Android/abi-arm64-v8a-Clang.cmake index f4717d5..c18c0a2 100644 --- a/Modules/Platform/Android/abi-arm64-v8a-Clang.cmake +++ b/Modules/Platform/Android/abi-arm64-v8a-Clang.cmake @@ -1,6 +1,3 @@ -# /build/core/toolchains/aarch64-linux-android-clang/setup.mk -set(_ANDROID_ABI_CLANG_TARGET "aarch64-none-linux-android") - # Suppress -Wl,-z,nocopyreloc flag on arm64-v8a set(_ANDROID_ABI_INIT_EXE_LDFLAGS_NO_nocopyreloc 1) diff --git a/Modules/Platform/Android/abi-armeabi-Clang.cmake b/Modules/Platform/Android/abi-armeabi-Clang.cmake index b857bd3..2b1de03 100644 --- a/Modules/Platform/Android/abi-armeabi-Clang.cmake +++ b/Modules/Platform/Android/abi-armeabi-Clang.cmake @@ -1,6 +1,3 @@ -# /build/core/toolchains/arm-linux-androideabi-clang/setup.mk -set(_ANDROID_ABI_CLANG_TARGET "armv5te-none-linux-androideabi") - string(APPEND _ANDROID_ABI_INIT_CFLAGS " -march=armv5te" ) diff --git a/Modules/Platform/Android/abi-armeabi-v6-Clang.cmake b/Modules/Platform/Android/abi-armeabi-v6-Clang.cmake index a7412f5..bb176ae 100644 --- a/Modules/Platform/Android/abi-armeabi-v6-Clang.cmake +++ b/Modules/Platform/Android/abi-armeabi-v6-Clang.cmake @@ -1,6 +1,3 @@ -# /build/core/toolchains/arm-linux-androideabi-clang/setup.mk -set(_ANDROID_ABI_CLANG_TARGET "armv6-none-linux-androideabi") - string(APPEND _ANDROID_ABI_INIT_CFLAGS " -march=armv6" ) diff --git a/Modules/Platform/Android/abi-armeabi-v7a-Clang.cmake b/Modules/Platform/Android/abi-armeabi-v7a-Clang.cmake index e2ab58b..6feeef6 100644 --- a/Modules/Platform/Android/abi-armeabi-v7a-Clang.cmake +++ b/Modules/Platform/Android/abi-armeabi-v7a-Clang.cmake @@ -1,6 +1,3 @@ -# /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" ) diff --git a/Modules/Platform/Android/abi-mips-Clang.cmake b/Modules/Platform/Android/abi-mips-Clang.cmake index 73addde..7df6a36 100644 --- a/Modules/Platform/Android/abi-mips-Clang.cmake +++ b/Modules/Platform/Android/abi-mips-Clang.cmake @@ -1,4 +1 @@ -# /build/core/toolchains/mipsel-linux-android-clang/setup.mk -set(_ANDROID_ABI_CLANG_TARGET "mipsel-none-linux-android") - include(Platform/Android/abi-common-Clang) diff --git a/Modules/Platform/Android/abi-mips64-Clang.cmake b/Modules/Platform/Android/abi-mips64-Clang.cmake index 603f1b2..7df6a36 100644 --- a/Modules/Platform/Android/abi-mips64-Clang.cmake +++ b/Modules/Platform/Android/abi-mips64-Clang.cmake @@ -1,4 +1 @@ -# /build/core/toolchains/mips64el-linux-android-clang/setup.mk -set(_ANDROID_ABI_CLANG_TARGET "mips64el-none-linux-android") - include(Platform/Android/abi-common-Clang) diff --git a/Modules/Platform/Android/abi-x86-Clang.cmake b/Modules/Platform/Android/abi-x86-Clang.cmake index fe7eace..7df6a36 100644 --- a/Modules/Platform/Android/abi-x86-Clang.cmake +++ b/Modules/Platform/Android/abi-x86-Clang.cmake @@ -1,4 +1 @@ -# /build/core/toolchains/x86-clang/setup.mk -set(_ANDROID_ABI_CLANG_TARGET "i686-none-linux-android") - include(Platform/Android/abi-common-Clang) diff --git a/Modules/Platform/Android/abi-x86_64-Clang.cmake b/Modules/Platform/Android/abi-x86_64-Clang.cmake index 3cbcd49..7df6a36 100644 --- a/Modules/Platform/Android/abi-x86_64-Clang.cmake +++ b/Modules/Platform/Android/abi-x86_64-Clang.cmake @@ -1,4 +1 @@ -# /build/core/toolchains/x86_64-clang/setup.mk -set(_ANDROID_ABI_CLANG_TARGET "x86_64-none-linux-android") - include(Platform/Android/abi-common-Clang) -- cgit v0.12