From 0de85741a3707c0be2fd1853157a1f23f315e788 Mon Sep 17 00:00:00 2001 From: Craig Scott Date: Tue, 22 Dec 2020 17:04:26 +1100 Subject: [PATCH] CMake: Prefer canonical CMAKE_ANDROID_NDK var when writing deploy file CMAKE_ANDROID_NDK is an official variable provided by CMake. The ANDROID_NDK variable will be set by the NDK toolchain file, but we don't need to rely on that (the user could theoretically not be using the NDK's toolchain file). Using the CMake-provided variable means we don't have to explain the source of the variable in documentation for the qt6_android_generate_deployment_settings() command. We should prefer to use things provided by CMake already where it makes sense and this seems to be one such case. Task-number: QTBUG-89651 Task-number: QTBUG-88839 Change-Id: Ieda54de8f5c65c36da6bb55c87a8b8fdd1d5cd7b Reviewed-by: Joerg Bornemann (cherry picked from commit 1b4d70676c3fed70a826b3a3cda3cd6c8077addf) Reviewed-by: Qt Cherry-pick Bot --- src/corelib/Qt6AndroidMacros.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/Qt6AndroidMacros.cmake b/src/corelib/Qt6AndroidMacros.cmake index 0ecde09d7cc..df04619605a 100644 --- a/src/corelib/Qt6AndroidMacros.cmake +++ b/src/corelib/Qt6AndroidMacros.cmake @@ -83,7 +83,7 @@ function(qt6_android_generate_deployment_settings target) " \"sdkBuildToolsRevision\": \"${QT_ANDROID_SDK_BUILD_TOOLS_REVISION}\",\n") # Android NDK - file(TO_CMAKE_PATH "${ANDROID_NDK}" android_ndk_root_native) + file(TO_CMAKE_PATH "${CMAKE_ANDROID_NDK}" android_ndk_root_native) string(APPEND file_contents " \"ndk\": \"${android_ndk_root_native}\",\n")