diff options
author | Lars Schmertmann <Lars.Schmertmann@governikus.de> | 2024-08-22 05:43:07 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2024-08-22 13:30:01 (GMT) |
commit | 24cd4ff84411752ed7545ac75fa121c6b7daa847 (patch) | |
tree | b54275c48ba13820ca73db0ec257bbc4665e4196 | |
parent | 9570ff0c7c32fc2b49a37d78a892e1fa0aa98495 (diff) | |
download | CMake-24cd4ff84411752ed7545ac75fa121c6b7daa847.zip CMake-24cd4ff84411752ed7545ac75fa121c6b7daa847.tar.gz CMake-24cd4ff84411752ed7545ac75fa121c6b7daa847.tar.bz2 |
Android: Fix build with NDK 27
`NDK_PROC_*_ABI` and `NDK_ARCH_*_ABI` were removed in the Android
NDK 27 but will be reintroduced in the Android NDK 27b:
* https://github.com/android/ndk/issues/2049
* https://android-review.googlesource.com/c/platform/ndk/+/3196345
Both are only used when `CMAKE_ANDROID_ARCH_ABI` is NOT given. But
currently the existence is also checked when `CMAKE_ANDROID_ARCH_ABI`
is given. So we move the checks to the position they are required.
-rw-r--r-- | Modules/Platform/Android-Determine.cmake | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/Modules/Platform/Android-Determine.cmake b/Modules/Platform/Android-Determine.cmake index cecdde8..342586d 100644 --- a/Modules/Platform/Android-Determine.cmake +++ b/Modules/Platform/Android-Determine.cmake @@ -375,21 +375,21 @@ endif() if(CMAKE_ANDROID_ARCH_ABI AND NOT DEFINED "NDK_ABI_${CMAKE_ANDROID_ARCH_ABI}_PROC") message(FATAL_ERROR "Android: Unknown ABI CMAKE_ANDROID_ARCH_ABI='${CMAKE_ANDROID_ARCH_ABI}'.") endif() -if(CMAKE_SYSTEM_PROCESSOR AND NOT DEFINED "NDK_PROC_${CMAKE_SYSTEM_PROCESSOR}_ABI") - message(FATAL_ERROR "Android: Unknown processor CMAKE_SYSTEM_PROCESSOR='${CMAKE_SYSTEM_PROCESSOR}'.") -endif() -if(_ANDROID_SYSROOT_ARCH AND NOT DEFINED "NDK_ARCH_${_ANDROID_SYSROOT_ARCH}_ABI") - message(FATAL_ERROR - "Android: Unknown architecture '${_ANDROID_SYSROOT_ARCH}' specified in CMAKE_SYSROOT:\n" - " ${CMAKE_SYSROOT}" - ) -endif() # Select an ABI. if(NOT CMAKE_ANDROID_ARCH_ABI) if(CMAKE_SYSTEM_PROCESSOR) + if(NOT DEFINED "NDK_PROC_${CMAKE_SYSTEM_PROCESSOR}_ABI") + message(FATAL_ERROR "Android: Unknown processor CMAKE_SYSTEM_PROCESSOR='${CMAKE_SYSTEM_PROCESSOR}'.") + endif() set(CMAKE_ANDROID_ARCH_ABI "${NDK_PROC_${CMAKE_SYSTEM_PROCESSOR}_ABI}") elseif(_ANDROID_SYSROOT_ARCH) + if(NOT DEFINED "NDK_ARCH_${_ANDROID_SYSROOT_ARCH}_ABI") + message(FATAL_ERROR + "Android: Unknown architecture '${_ANDROID_SYSROOT_ARCH}' specified in CMAKE_SYSROOT:\n" + " ${CMAKE_SYSROOT}" + ) + endif() set(CMAKE_ANDROID_ARCH_ABI "${NDK_ARCH_${_ANDROID_SYSROOT_ARCH}_ABI}") elseif(_INCLUDED_ABIS) # Default to the oldest ARM ABI. |