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 <alexandru.croitor@qt.io>
(cherry picked from commit cda51bcd9cdffc7f5541f1bba90dc608575fb07b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Alexey Edelev 2025-03-03 13:25:37 +01:00 committed by Qt Cherry-pick Bot
parent 11721dffdf
commit b27ba33a66

View File

@ -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.