summaryrefslogtreecommitdiffstats
path: root/Modules/Platform/Android.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-02-06 22:08:10 (GMT)
committerBrad King <brad.king@kitware.com>2023-02-06 22:17:25 (GMT)
commitcb0b9452e8c9a47ddfa29cfa0bd7e5e21ea2c389 (patch)
tree0d86d9d6473e3968d636d761521c979370f93e3d /Modules/Platform/Android.cmake
parent4db877ce9ae43a8a6b496a7ab3ef9568b6049a4f (diff)
downloadCMake-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/Platform/Android.cmake')
-rw-r--r--Modules/Platform/Android.cmake2
1 files changed, 2 insertions, 0 deletions
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()