diff options
author | Brad King <brad.king@kitware.com> | 2018-08-30 13:14:25 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2018-08-30 13:14:32 (GMT) |
commit | 14553ab64b73b52e256f75c6aa5e9c3cdbb2eba6 (patch) | |
tree | 047298fc299d2972e08556a77300314348b2ef4e /Modules | |
parent | e04a023eabc9ec309d002a9acd887d79f65d4b84 (diff) | |
parent | ca97d4cb5f5872fb63b36a09fff6ee865bbcbb23 (diff) | |
download | CMake-14553ab64b73b52e256f75c6aa5e9c3cdbb2eba6.zip CMake-14553ab64b73b52e256f75c6aa5e9c3cdbb2eba6.tar.gz CMake-14553ab64b73b52e256f75c6aa5e9c3cdbb2eba6.tar.bz2 |
Merge topic 'android-ndk-r18'
ca97d4cb5f Android: Add support for NDK r18
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2319
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/Platform/Android-Common.cmake | 4 | ||||
-rw-r--r-- | Modules/Platform/Android/Determine-Compiler-NDK.cmake | 13 |
2 files changed, 15 insertions, 2 deletions
diff --git a/Modules/Platform/Android-Common.cmake b/Modules/Platform/Android-Common.cmake index 80a8f41..f8b9346 100644 --- a/Modules/Platform/Android-Common.cmake +++ b/Modules/Platform/Android-Common.cmake @@ -32,8 +32,10 @@ if(CMAKE_ANDROID_NDK) ) endif() unset(_ANDROID_STL_TYPE_FOUND) - else() + elseif(IS_DIRECTORY ${CMAKE_ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++) set(CMAKE_ANDROID_STL_TYPE "gnustl_static") + else() + set(CMAKE_ANDROID_STL_TYPE "c++_static") endif() unset(_ANDROID_STL_TYPES) diff --git a/Modules/Platform/Android/Determine-Compiler-NDK.cmake b/Modules/Platform/Android/Determine-Compiler-NDK.cmake index 0649925..5f2cc52 100644 --- a/Modules/Platform/Android/Determine-Compiler-NDK.cmake +++ b/Modules/Platform/Android/Determine-Compiler-NDK.cmake @@ -35,7 +35,18 @@ elseif(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION) endif() set(_ANDROID_TOOL_PATTERNS "*-${CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION}") else() - set(_ANDROID_TOOL_PATTERNS "*-[0-9].[0-9]") + # If we can find any gcc toolchains then use one by default. + # Otherwise we look for clang toolchains (e.g. NDK r18+). + file(GLOB _ANDROID_CONFIG_MKS_FOR_GCC + "${CMAKE_ANDROID_NDK}/build/core/toolchains/*-[0-9].[0-9]/config.mk" + "${CMAKE_ANDROID_NDK}/toolchains/*-[0-9].[0-9]/config.mk" + ) + if(_ANDROID_CONFIG_MKS_FOR_GCC) + set(_ANDROID_TOOL_PATTERNS "*-[0-9].[0-9]") + else() + set(_ANDROID_TOOL_PATTERNS "*-clang") + endif() + unset(_ANDROID_CONFIG_MKS_FOR_GCC) endif() set(_ANDROID_CONFIG_MK_PATTERNS) foreach(base "build/core/toolchains" "toolchains") |