diff options
author | Brad King <brad.king@kitware.com> | 2018-08-27 19:28:53 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-08-28 13:27:26 (GMT) |
commit | ca97d4cb5f5872fb63b36a09fff6ee865bbcbb23 (patch) | |
tree | 60fd4e6d8ad633e947da57155f2f1f9dc5175e8a /Tests/RunCMake/Android/RunCMakeTest.cmake | |
parent | c4ab098097f4fe1bc85ee29c6de390dff435f63f (diff) | |
download | CMake-ca97d4cb5f5872fb63b36a09fff6ee865bbcbb23.zip CMake-ca97d4cb5f5872fb63b36a09fff6ee865bbcbb23.tar.gz CMake-ca97d4cb5f5872fb63b36a09fff6ee865bbcbb23.tar.bz2 |
Android: Add support for NDK r18
NDK r18 drops GCC toolchains and some STL types. We need to choose a
clang toolchain by default when no gcc toolchains are available. Switch
the STL type default to `c++_static` when the old `gnustl_static`
default is not available.
Update the test suite to not run tests for STL types that do not exist.
Also do not expect the gcc toolchain `cpp` tool to be available because
r18 does not provide it. Also teach it to tolerate `gcc -dumpmachine`
output like `arm--linux-android` that differs from the toolchain prefix.
Fixes: #18301
Diffstat (limited to 'Tests/RunCMake/Android/RunCMakeTest.cmake')
-rw-r--r-- | Tests/RunCMake/Android/RunCMakeTest.cmake | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/Tests/RunCMake/Android/RunCMakeTest.cmake b/Tests/RunCMake/Android/RunCMakeTest.cmake index 2027c4f..45798ce 100644 --- a/Tests/RunCMake/Android/RunCMakeTest.cmake +++ b/Tests/RunCMake/Android/RunCMakeTest.cmake @@ -61,8 +61,12 @@ foreach(ndk IN LISTS TEST_ANDROID_NDK) list(APPEND _abis_${_version} ${_abis}) endif() endforeach() - set(_abis_ ${_abis_${_latest_gcc}}) set(_abis_clang ${_abis_${_latest_clang}}) + if(_latest_gcc) + set(_abis_ ${_abis_${_latest_gcc}}) + else() + set(_abis_ ${_abis_clang}) + endif() if(_versions MATCHES "clang") set(_versions "clang" ${_versions}) endif() @@ -132,10 +136,11 @@ foreach(ndk IN LISTS TEST_ANDROID_NDK) set(stl_types none system - gnustl_static - gnustl_shared ) + if(IS_DIRECTORY "${ndk}/sources/cxx-stl/gnu-libstdc++") + list(APPEND stl_types gnustl_static gnustl_shared) + endif() if(IS_DIRECTORY "${ndk}/sources/cxx-stl/gabi++/libs") list(APPEND stl_types gabi++_static gabi++_shared) endif() |