From b27ba33a6639159e03a7c8a3ed920b739c5b6c65 Mon Sep 17 00:00:00 2001 From: Alexey Edelev Date: Mon, 3 Mar 2025 13:25:37 +0100 Subject: [PATCH] Move detecting of USE_TERMINAL flag to a separate function The logic is generic, make it accessible from the function. Pick-to: 6.8 Change-Id: Ib361399722dba689891d301e20b3f713450e676f Reviewed-by: Alexandru Croitor (cherry picked from commit cda51bcd9cdffc7f5541f1bba90dc608575fb07b) Reviewed-by: Qt Cherry-pick Bot --- src/corelib/Qt6AndroidMacros.cmake | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/corelib/Qt6AndroidMacros.cmake b/src/corelib/Qt6AndroidMacros.cmake index 1e285784e7e..91d6d7c865a 100644 --- a/src/corelib/Qt6AndroidMacros.cmake +++ b/src/corelib/Qt6AndroidMacros.cmake @@ -573,9 +573,7 @@ function(qt6_android_add_apk_target target) set(extra_deps "") - if(QT_ENABLE_VERBOSE_DEPLOYMENT) - set(uses_terminal USES_TERMINAL) - endif() + _qt_internal_android_get_use_terminal_for_deployment(uses_terminal) # Plugins still might be added after creating the deployment targets. if(NOT TARGET qt_internal_plugins) @@ -1784,6 +1782,15 @@ function(_qt_internal_expose_android_package_source_dir_to_ide target) endif() endfunction() +# Enables the terminal usage for the add_custom_command calls when verbose deployment is enabled. +function(_qt_internal_android_get_use_terminal_for_deployment out_var) + if(QT_ENABLE_VERBOSE_DEPLOYMENT) + set(${out_var} USES_TERMINAL PARENT_SCOPE) + else() + set(${out_var} "" PARENT_SCOPE) + endif() +endfunction() + # Return the one of the deployment flags either release or debug depending on # the preferred config. The returned "flags" are wrapped into generator # expression so only usable at the generator stage.