diff options
author | Brad King <brad.king@kitware.com> | 2023-02-07 14:32:05 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2023-02-07 14:32:19 (GMT) |
commit | 5d40cf45fa3935cb1c9c5a3b12714f8200938813 (patch) | |
tree | 7982e23a81f1f5666938ff8e0213af58440b250d | |
parent | c323d446d6eec5c1c06fa99d3520ec15e3ab5c8c (diff) | |
parent | cb0b9452e8c9a47ddfa29cfa0bd7e5e21ea2c389 (diff) | |
download | CMake-5d40cf45fa3935cb1c9c5a3b12714f8200938813.zip CMake-5d40cf45fa3935cb1c9c5a3b12714f8200938813.tar.gz CMake-5d40cf45fa3935cb1c9c5a3b12714f8200938813.tar.bz2 |
Merge topic 'android-ndk-legacy-toolchain' into release-3.26
cb0b9452e8 Android: Provide CMAKE_ANDROID_NDK_VERSION with NDK legacy toolchain file
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !8170
-rw-r--r-- | Modules/Compiler/Clang.cmake | 2 | ||||
-rw-r--r-- | Modules/Platform/Android.cmake | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/Modules/Compiler/Clang.cmake b/Modules/Compiler/Clang.cmake index b59b38c..6c544fd 100644 --- a/Modules/Compiler/Clang.cmake +++ b/Modules/Compiler/Clang.cmake @@ -80,7 +80,7 @@ else() set(CMAKE_${lang}_COMPILE_OPTIONS_IPO "-flto") endif() - if(ANDROID AND CMAKE_ANDROID_NDK_VERSION VERSION_LESS "22") + if(ANDROID AND NOT CMAKE_ANDROID_NDK_VERSION VERSION_GREATER_EQUAL "22") # https://github.com/android-ndk/ndk/issues/242 set(CMAKE_${lang}_LINK_OPTIONS_IPO "-fuse-ld=gold") endif() diff --git a/Modules/Platform/Android.cmake b/Modules/Platform/Android.cmake index d0f686c..0530988 100644 --- a/Modules/Platform/Android.cmake +++ b/Modules/Platform/Android.cmake @@ -39,6 +39,8 @@ endif() # Commonly used Android toolchain files that pre-date CMake upstream support # set CMAKE_SYSTEM_VERSION to 1. Avoid interfering with them. if(CMAKE_SYSTEM_VERSION EQUAL 1) + # The NDK legacy toolchain file provides its version number. + set(CMAKE_ANDROID_NDK_VERSION ${ANDROID_NDK_MAJOR}.${ANDROID_NDK_MINOR}) return() endif() |