Ensure optional_arg is reset in qt_internal_add_global_definition

Othewise there is a risk that variable is taken from other scopes.
(Random finding).

Pick-to: 6.8 6.5
Change-Id: I2517adec5d82639e95ac2758633109413811cf9a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 6685da4ec9e3b1eb8a09052c3abb2d614f96d7cc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Alexey Edelev 2025-02-27 17:29:50 +01:00 committed by Qt Cherry-pick Bot
parent 66a10a141e
commit 8909279d3e

View File

@ -136,7 +136,7 @@ endfunction()
# APP - set the definition for all Qt applications
# TODO: Add a tests specific platform target and the definition scope for it.
function(qt_internal_add_global_definition definition)
set(optional_args)
set(optional_args "")
set(single_value_args VALUE)
set(multi_value_args SCOPE)
cmake_parse_arguments(arg