diff options
author | Brad King <brad.king@kitware.com> | 2023-02-06 22:08:10 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-02-06 22:17:25 (GMT) |
commit | cb0b9452e8c9a47ddfa29cfa0bd7e5e21ea2c389 (patch) | |
tree | 0d86d9d6473e3968d636d761521c979370f93e3d /Modules/Compiler | |
parent | 4db877ce9ae43a8a6b496a7ab3ef9568b6049a4f (diff) | |
download | CMake-cb0b9452e8c9a47ddfa29cfa0bd7e5e21ea2c389.zip CMake-cb0b9452e8c9a47ddfa29cfa0bd7e5e21ea2c389.tar.gz CMake-cb0b9452e8c9a47ddfa29cfa0bd7e5e21ea2c389.tar.bz2 |
Android: Provide CMAKE_ANDROID_NDK_VERSION with NDK legacy toolchain file
This variable has been provided since commit 746906242d (Android: Detect
NDK version number, 2021-02-26, v3.20.0-rc3~1^2~3) when using CMake's
NDK support or the modern NDK toolchain file. Since commit 005e2cdfb0
(Android: Do not use gold for ndk >= r22, 2021-02-26, v3.20.0-rc3~1^2)
we need the value in our compiler/platform information files, so provide
it when using the NDK legacy toolchain file too.
Revert commit 1c86e397fe (Android/Clang: Tolerate undefined
CMAKE_ANDROID_NDK_VERSION, 2022-09-16, v3.25.0-rc1~118^2) since the
variable should now always be defined.
Issue: #21772
Fixes: #24386
Diffstat (limited to 'Modules/Compiler')
-rw-r--r-- | Modules/Compiler/Clang.cmake | 2 |
1 files changed, 1 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() |