summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@qt.io>2024-03-11 14:09:01 +0100
committerJoerg Bornemann <joerg.bornemann@qt.io>2024-03-27 00:14:02 +0100
commitc11beb8d324ca7800e92e051f8a309072ac22434 (patch)
tree26a90e9fbc897de49a6b1699f44385e3b65e2e2c /cmake
parente685bfe764fa78117766b708b5219768f2a893b1 (diff)
configure: Fix -c++std and -sanitize options
This amends commit 110f656da9e9b2511c89679e79b197a3e7b07393. Command line options with a TYPE that denotes a custom command line argument handler cannot set a feature "foo" anymore by just setting INPUT_foo to "yes". Instead, they must use the newly introduced functions qtConfCommandlineEnableFeature and qtConfCommandlineDisableFeature. These functions will set INPUT_foo and augment the input with the information "this input is of boolean type". This information is used when deciding whether to use this input as feature switch. Change-Id: I83c691cc57424159148f059c2a1c8cd72e39ee63 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/QtProcessConfigureArgs.cmake22
1 files changed, 21 insertions, 1 deletions
diff --git a/cmake/QtProcessConfigureArgs.cmake b/cmake/QtProcessConfigureArgs.cmake
index 5e2b92a19c..2080d3222a 100644
--- a/cmake/QtProcessConfigureArgs.cmake
+++ b/cmake/QtProcessConfigureArgs.cmake
@@ -287,7 +287,7 @@ function(qt_commandline_option name)
set(input_name ${arg_NAME})
set(commandline_option_${name}_variable "${arg_NAME}" PARENT_SCOPE)
endif()
- set(commandline_input_${input_name}_type "${arg_TYPE}" PARENT_SCOPE)
+ set_property(GLOBAL PROPERTY INPUTTYPE_${input_name} "${arg_TYPE}")
if(NOT "${arg_VALUE}" STREQUAL "")
set(commandline_option_${name}_value "${arg_VALUE}" PARENT_SCOPE)
endif()
@@ -378,6 +378,23 @@ function(qtConfCommandlineAppendInput name val)
qtConfCommandlineSetInput(${name} "${val}")
endfunction()
+function(qtConfCommandlineSetInputType input_name type_name)
+ set_property(GLOBAL PROPERTY INPUTTYPE_${input_name} "${type_name}")
+endfunction()
+
+function(qtConfCommandlineSetBooleanInput name val)
+ qtConfCommandlineSetInput(${name} ${val})
+ qtConfCommandlineSetInputType(${name} boolean)
+endfunction()
+
+function(qtConfCommandlineEnableFeature name)
+ qtConfCommandlineSetBooleanInput(${name} yes)
+endfunction()
+
+function(qtConfCommandlineDisableFeature name)
+ qtConfCommandlineSetBooleanInput(${name} no)
+endfunction()
+
function(qtConfValidateValue opt val out_var)
set(${out_var} TRUE PARENT_SCOPE)
@@ -753,6 +770,9 @@ get_property(config_inputs GLOBAL PROPERTY CONFIG_INPUTS)
list(REMOVE_DUPLICATES config_inputs)
foreach(var ${config_inputs})
get_property(INPUT_${var} GLOBAL PROPERTY INPUT_${var})
+ if("${commandline_input_type}" STREQUAL "")
+ get_property(commandline_input_${var}_type GLOBAL PROPERTY INPUTTYPE_${var})
+ endif()
endforeach()
macro(drop_input name)