diff options
author | Brad King <brad.king@kitware.com> | 2020-11-11 14:31:57 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-11-11 14:33:02 (GMT) |
commit | 566ad7c61e541595418b1b18e60ddaa6f24d05bf (patch) | |
tree | 2c41547aac294cbd5ed3414dcdd35041dc3191bb /Modules/Platform/Android-Determine.cmake | |
parent | adfc6044dbf0264799a5395e6bb84144a67c93d7 (diff) | |
parent | a585b75df98c9cd995ed1f50f76887378bac4978 (diff) | |
download | CMake-566ad7c61e541595418b1b18e60ddaa6f24d05bf.zip CMake-566ad7c61e541595418b1b18e60ddaa6f24d05bf.tar.gz CMake-566ad7c61e541595418b1b18e60ddaa6f24d05bf.tar.bz2 |
Merge topic 'android-abi'
a585b75df9 Android: Use NDK_KNOWN_DEVICE_ABI{32,64}S instead of NDK_DEFAULT_ABIS
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5488
Diffstat (limited to 'Modules/Platform/Android-Determine.cmake')
-rw-r--r-- | Modules/Platform/Android-Determine.cmake | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/Modules/Platform/Android-Determine.cmake b/Modules/Platform/Android-Determine.cmake index 2c906ae..77e621a 100644 --- a/Modules/Platform/Android-Determine.cmake +++ b/Modules/Platform/Android-Determine.cmake @@ -208,8 +208,13 @@ if(NOT CMAKE_ANDROID_NDK AND NOT CMAKE_ANDROID_STANDALONE_TOOLCHAIN) endif() if(CMAKE_ANDROID_NDK) - # NDK >= 18 has abis.cmake and platforms.cmake. + # NDK >= 18 has platforms.cmake. It provides: + # NDK_MIN_PLATFORM_LEVEL + # NDK_MAX_PLATFORM_LEVEL include("${CMAKE_ANDROID_NDK}/build/cmake/platforms.cmake" OPTIONAL RESULT_VARIABLE _INCLUDED_PLATFORMS) + # NDK >= 18 has abis.cmake. It provides: + # NDK_KNOWN_DEVICE_ABI32S + # NDK_KNOWN_DEVICE_ABI64S include("${CMAKE_ANDROID_NDK}/build/cmake/abis.cmake" OPTIONAL RESULT_VARIABLE _INCLUDED_ABIS) endif() @@ -247,6 +252,10 @@ else() set(CMAKE_ANDROID_NDK_TOOLCHAIN_UNIFIED "") endif() +if(_INCLUDED_ABIS) + set(_ANDROID_KNOWN_ABIS ${NDK_KNOWN_DEVICE_ABI32S} ${NDK_KNOWN_DEVICE_ABI64S}) +endif() + # https://developer.android.com/ndk/guides/abis.html set(_ANDROID_ABI_arm64-v8a_PROC "aarch64") @@ -321,7 +330,7 @@ if(NOT CMAKE_ANDROID_ARCH_ABI) elseif(_INCLUDED_ABIS) # Default to the oldest ARM ABI. foreach(abi armeabi armeabi-v7a arm64-v8a) - if("${abi}" IN_LIST NDK_DEFAULT_ABIS) + if("${abi}" IN_LIST _ANDROID_KNOWN_ABIS) set(CMAKE_ANDROID_ARCH_ABI "${abi}") break() endif() @@ -367,10 +376,10 @@ if(NOT CMAKE_ANDROID_ARCH_ABI) endif() endif() endif() -if(_INCLUDED_ABIS AND NOT CMAKE_ANDROID_ARCH_ABI IN_LIST NDK_DEFAULT_ABIS) +if(_INCLUDED_ABIS AND NOT CMAKE_ANDROID_ARCH_ABI IN_LIST _ANDROID_KNOWN_ABIS) message(FATAL_ERROR "Android: ABI '${CMAKE_ANDROID_ARCH_ABI}' is not supported by the NDK.\n" - "Supported ABIS: ${NDK_DEFAULT_ABIS}." + "Supported ABIS: ${_ANDROID_KNOWN_ABIS}." ) endif() set(CMAKE_ANDROID_ARCH "${_ANDROID_ABI_${CMAKE_ANDROID_ARCH_ABI}_ARCH}") |