CMake: Fix forwarding the '0' argument which is by default falsey

If the forward argument was meant to be 0, it was not forwarded
because it evaluated to false in if(condition).

To pass it along, instead check for empty strings.

Change-Id: Ia366df147de0c2d333017da43dc0643b56a89e9c
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 96abceb64e5dc0570ca7c3419f401cfafe946ba0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Alexandru Croitor 2024-06-05 18:21:00 +02:00 committed by Qt Cherry-pick Bot
parent b1481a1663
commit e83de10922

View File

@ -641,13 +641,13 @@ function(_qt_internal_forward_function_args)
endforeach()
foreach(option_name IN LISTS arg_FORWARD_SINGLE)
if(${arg_FORWARD_PREFIX}_${option_name})
if(NOT "${arg_FORWARD_PREFIX}_${option_name}" STREQUAL "")
list(APPEND forward_args "${option_name}" "${${arg_FORWARD_PREFIX}_${option_name}}")
endif()
endforeach()
foreach(option_name IN LISTS arg_FORWARD_MULTI)
if(${arg_FORWARD_PREFIX}_${option_name})
if(NOT "${arg_FORWARD_PREFIX}_${option_name}" STREQUAL "")
list(APPEND forward_args "${option_name}" ${${arg_FORWARD_PREFIX}_${option_name}})
endif()
endforeach()