diff options
author | Brad King <brad.king@kitware.com> | 2023-02-06 22:27:48 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-02-06 22:27:48 (GMT) |
commit | 29dc3e7722048e20f238eaed861324b925ba6399 (patch) | |
tree | 0d86d9d6473e3968d636d761521c979370f93e3d | |
parent | 4db877ce9ae43a8a6b496a7ab3ef9568b6049a4f (diff) | |
parent | cb0b9452e8c9a47ddfa29cfa0bd7e5e21ea2c389 (diff) | |
download | CMake-29dc3e7722048e20f238eaed861324b925ba6399.zip CMake-29dc3e7722048e20f238eaed861324b925ba6399.tar.gz CMake-29dc3e7722048e20f238eaed861324b925ba6399.tar.bz2 |
Merge branch 'android-ndk-legacy-toolchain' into release-3.25
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 4f9af37..257402a 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() |