From 9819e9c2e0928094ffbb4daba3f01d8e04570b00 Mon Sep 17 00:00:00 2001 From: Alexey Edelev Date: Mon, 3 Mar 2025 13:08:35 +0100 Subject: [PATCH] Move the genex that returns Android SDK tools revision to a function The genex will be generic, so make it accessible from function. Pick-to: 6.8 6.9 Change-Id: I83246890e2d81f3cdbbd8fe2b93d59968623a889 Reviewed-by: Assam Boudjelthia Reviewed-by: Alexandru Croitor --- src/corelib/Qt6AndroidMacros.cmake | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/src/corelib/Qt6AndroidMacros.cmake b/src/corelib/Qt6AndroidMacros.cmake index e61175b3cbb..0edb112e786 100644 --- a/src/corelib/Qt6AndroidMacros.cmake +++ b/src/corelib/Qt6AndroidMacros.cmake @@ -21,6 +21,22 @@ function(_qt_internal_android_get_sdk_build_tools_revision out_var) set(${out_var} "${android_build_tools_latest}" PARENT_SCOPE) endfunction() +# Returns the target specific Android SDK tools revision. The function falls +# back to the calculated value if the QT_ANDROID_SDK_BUILD_TOOLS_REVISION +# target property is not set. +function(_qt_internal_android_get_target_sdk_build_tools_revision out_var target) + _qt_internal_android_get_sdk_build_tools_revision(android_sdk_build_tools) + set(android_sdk_build_tools_genex "") + string(APPEND android_sdk_build_tools_genex + "$>," + "$," + "${android_sdk_build_tools}" + ">" + ) + + set(${out_var} "${android_sdk_build_tools_genex}" PARENT_SCOPE) +endfunction() + # The function appends to the 'out_var' a 'json_property' that contains the 'tool' path. If 'tool' # target or its IMPORTED_LOCATION are not found the function displays warning, but is not failing # at the project configuring phase. @@ -179,14 +195,9 @@ function(qt6_android_generate_deployment_settings target) " \"sdk\": \"${android_sdk_root_native}\",\n") # Android SDK Build Tools Revision - _qt_internal_android_get_sdk_build_tools_revision(android_sdk_build_tools) - set(android_sdk_build_tools_genex "") - string(APPEND android_sdk_build_tools_genex - "$>," - "$," - "${android_sdk_build_tools}" - ">" - ) + _qt_internal_android_get_target_sdk_build_tools_revision(android_sdk_build_tools_genex + ${target}) + string(APPEND file_contents " \"sdkBuildToolsRevision\": \"${android_sdk_build_tools_genex}\",\n")