diff options
author | Assam Boudjelthia <assam.boudjelthia@qt.io> | 2022-03-08 15:08:00 +0200 |
---|---|---|
committer | Assam Boudjelthia <assam.boudjelthia@qt.io> | 2022-03-11 18:30:32 +0200 |
commit | db2f47337b3996ace994495d0de7d721f108e8f0 (patch) | |
tree | 26807d9082f426a9524d4032d1875b2615bd4f8b /cmake/QtPriHelpers.cmake | |
parent | 888b75aa12e2cf35ee760bcf5cb1ed60fe0c0770 (diff) |
CMake:Android: Use ANDROID_PLATFORM instead of ANDROID_NATIVE_API_LEVEL
ANDROID_NATIVE_API_LEVEL is an alias for ANDROID_PLATFORM and the
Android's CMake docs [1] uses directly ANDROID_PLATFORM so let's use
that as well. Also, NDK r23b seems to have removed the part of code from
android.toolchain.cmake that handles ANDROID_NATIVE_API_LEVEL to set
the correct value to ANDROID_PLATFORM.
With this change, CMake will pass the value from the configure argument
-android-ndk-platform as -DANDROID_PLATFORM instead of
-DANDROID_NATIVE_API_LEVEL. Otherwise, if if -DANDROID_NATIVE_API_LEVEL
is passed directly to CMake, it should work as before.
[1] https://developer.android.com/ndk/guides/cmake#build-command
Pick-to: 6.3
Task-number: QTQAINFRA-4837
Change-Id: I5c21af53ac91e11a27c4b033313d22d1115c1abc
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'cmake/QtPriHelpers.cmake')
-rw-r--r-- | cmake/QtPriHelpers.cmake | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/cmake/QtPriHelpers.cmake b/cmake/QtPriHelpers.cmake index 8f7e3e9b86..61080da7ef 100644 --- a/cmake/QtPriHelpers.cmake +++ b/cmake/QtPriHelpers.cmake @@ -792,7 +792,9 @@ function(qt_generate_global_device_pri_file) string(APPEND content "DEFAULT_ANDROID_NDK_ROOT = ${ANDROID_NDK}\n") set(android_platform "android-23") - if(ANDROID_NATIVE_API_LEVEL) + if(ANDROID_PLATFORM) + set(android_platform "${ANDROID_PLATFORM}") + elseif(ANDROID_NATIVE_API_LEVEL) set(android_platform "android-${ANDROID_NATIVE_API_LEVEL}") endif() string(APPEND content "DEFAULT_ANDROID_PLATFORM = ${android_platform}\n") |