From db2f47337b3996ace994495d0de7d721f108e8f0 Mon Sep 17 00:00:00 2001 From: Assam Boudjelthia Date: Tue, 8 Mar 2022 15:08:00 +0200 Subject: 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 --- cmake/QtProcessConfigureArgs.cmake | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'cmake/QtProcessConfigureArgs.cmake') diff --git a/cmake/QtProcessConfigureArgs.cmake b/cmake/QtProcessConfigureArgs.cmake index c74fbbf733..09bc914f80 100644 --- a/cmake/QtProcessConfigureArgs.cmake +++ b/cmake/QtProcessConfigureArgs.cmake @@ -824,8 +824,7 @@ translate_path_input(android-sdk ANDROID_SDK_ROOT) translate_path_input(android-ndk ANDROID_NDK_ROOT) if(DEFINED INPUT_android-ndk-platform) drop_input(android-ndk-platform) - string(REGEX REPLACE "^android-" "" INPUT_android-ndk-platform "${INPUT_android-ndk-platform}") - push("-DANDROID_NATIVE_API_LEVEL=${INPUT_android-ndk-platform}") + push("-DANDROID_PLATFORM=${INPUT_android-ndk-platform}") endif() if(DEFINED INPUT_android-abis) if(INPUT_android-abis MATCHES ",") -- cgit v1.2.3