[Cmake-commits] CMake branch, master, updated. v3.11.1-520-g48b5daa
Kitware Robot
kwrobot at kitware.com
Wed Apr 18 08:35:05 EDT 2018
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, master has been updated
via 48b5daaf7c497cc91fb48bb006ac7b83229171a9 (commit)
via da294a039dec5e4f97da742b8e3cb94f25b82230 (commit)
from 9260dedfd2ab473d87679e215ea10cd572765766 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=48b5daaf7c497cc91fb48bb006ac7b83229171a9
commit 48b5daaf7c497cc91fb48bb006ac7b83229171a9
Merge: 9260ded da294a0
Author: Brad King <brad.king at kitware.com>
AuthorDate: Wed Apr 18 12:29:55 2018 +0000
Commit: Kitware Robot <kwrobot at kitware.com>
CommitDate: Wed Apr 18 08:30:00 2018 -0400
Merge topic 'android-ndk-r17'
da294a039d Android: Add support for NDK r17
Acked-by: Kitware Robot <kwrobot at kitware.com>
Merge-request: !1976
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=da294a039dec5e4f97da742b8e3cb94f25b82230
commit da294a039dec5e4f97da742b8e3cb94f25b82230
Author: Brad King <brad.king at kitware.com>
AuthorDate: Tue Apr 17 10:42:19 2018 -0400
Commit: Brad King <brad.king at kitware.com>
CommitDate: Tue Apr 17 11:21:15 2018 -0400
Android: Add support for NDK r17
The `armeabi` ABI is no longer available, so we can no longer use it by
default unconditionally. Instead detect all available ABIs and choose
the oldest arm ABI that is available.
Also update the test suite to account for the lack of `armeabi` support
and pass as of Android NDK r17-beta2.
diff --git a/Modules/Platform/Android-Determine.cmake b/Modules/Platform/Android-Determine.cmake
index add1dc1..e623902 100644
--- a/Modules/Platform/Android-Determine.cmake
+++ b/Modules/Platform/Android-Determine.cmake
@@ -261,7 +261,40 @@ if(NOT CMAKE_ANDROID_ARCH_ABI)
else()
# https://developer.android.com/ndk/guides/application_mk.html
# Default is the oldest ARM ABI.
- set(CMAKE_ANDROID_ARCH_ABI "armeabi")
+
+ # Lookup the available ABIs among all toolchains.
+ set(_ANDROID_ABIS "")
+ file(GLOB _ANDROID_CONFIG_MKS
+ "${CMAKE_ANDROID_NDK}/build/core/toolchains/*/config.mk"
+ "${CMAKE_ANDROID_NDK}/toolchains/*/config.mk"
+ )
+ foreach(config_mk IN LISTS _ANDROID_CONFIG_MKS)
+ file(STRINGS "${config_mk}" _ANDROID_TOOL_ABIS REGEX "^TOOLCHAIN_ABIS :=")
+ string(REPLACE "TOOLCHAIN_ABIS :=" "" _ANDROID_TOOL_ABIS "${_ANDROID_TOOL_ABIS}")
+ separate_arguments(_ANDROID_TOOL_ABIS UNIX_COMMAND "${_ANDROID_TOOL_ABIS}")
+ list(APPEND _ANDROID_ABIS ${_ANDROID_TOOL_ABIS})
+ unset(_ANDROID_TOOL_ABIS)
+ endforeach()
+ unset(_ANDROID_CONFIG_MKS)
+
+ # Choose the oldest among the available arm ABIs.
+ if(_ANDROID_ABIS)
+ list(REMOVE_DUPLICATES _ANDROID_ABIS)
+ cmake_policy(PUSH)
+ cmake_policy(SET CMP0057 NEW)
+ foreach(abi armeabi armeabi-v7a arm64-v8a)
+ if("${abi}" IN_LIST _ANDROID_ABIS)
+ set(CMAKE_ANDROID_ARCH_ABI "${abi}")
+ break()
+ endif()
+ endforeach()
+ cmake_policy(POP)
+ endif()
+ unset(_ANDROID_ABIS)
+
+ if(NOT CMAKE_ANDROID_ARCH_ABI)
+ set(CMAKE_ANDROID_ARCH_ABI "armeabi")
+ endif()
endif()
endif()
set(CMAKE_ANDROID_ARCH "${_ANDROID_ABI_${CMAKE_ANDROID_ARCH_ABI}_ARCH}")
diff --git a/Tests/RunCMake/Android/RunCMakeTest.cmake b/Tests/RunCMake/Android/RunCMakeTest.cmake
index 86a9896..2027c4f 100644
--- a/Tests/RunCMake/Android/RunCMakeTest.cmake
+++ b/Tests/RunCMake/Android/RunCMakeTest.cmake
@@ -88,12 +88,14 @@ foreach(ndk IN LISTS TEST_ANDROID_NDK)
-DCMAKE_ANDROID_ARM_MODE=0
)
run_cmake(ndk-badarm)
- set(RunCMake_TEST_OPTIONS
- -DCMAKE_SYSTEM_NAME=Android
- -DCMAKE_ANDROID_NDK=${ndk}
- -DCMAKE_ANDROID_ARM_NEON=0
- )
- run_cmake(ndk-badneon)
+ if("armeabi" IN_LIST _abis_)
+ set(RunCMake_TEST_OPTIONS
+ -DCMAKE_SYSTEM_NAME=Android
+ -DCMAKE_ANDROID_NDK=${ndk}
+ -DCMAKE_ANDROID_ARM_NEON=0
+ )
+ run_cmake(ndk-badneon)
+ endif()
set(RunCMake_TEST_OPTIONS
-DCMAKE_SYSTEM_NAME=Android
-DCMAKE_ANDROID_NDK=${ndk}
diff --git a/Tests/RunCMake/Android/ndk-badvernum-stderr.txt b/Tests/RunCMake/Android/ndk-badvernum-stderr.txt
index 25bbaf9..adacaf1 100644
--- a/Tests/RunCMake/Android/ndk-badvernum-stderr.txt
+++ b/Tests/RunCMake/Android/ndk-badvernum-stderr.txt
@@ -1,5 +1,5 @@
^CMake Error at .*/Modules/Platform/Android/Determine-Compiler-NDK.cmake:[0-9]+ \(message\):
- Android: No toolchain for ABI 'armeabi' found in the NDK:
+ Android: No toolchain for ABI 'armeabi(-v7a)?' found in the NDK:
.*
-----------------------------------------------------------------------
Summary of changes:
Modules/Platform/Android-Determine.cmake | 35 ++++++++++++++++++++++-
Tests/RunCMake/Android/RunCMakeTest.cmake | 14 +++++----
Tests/RunCMake/Android/ndk-badvernum-stderr.txt | 2 +-
3 files changed, 43 insertions(+), 8 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list