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>
This commit is contained in:
parent
e685bfe764
commit
c11beb8d32
@ -287,7 +287,7 @@ function(qt_commandline_option name)
|
|||||||
set(input_name ${arg_NAME})
|
set(input_name ${arg_NAME})
|
||||||
set(commandline_option_${name}_variable "${arg_NAME}" PARENT_SCOPE)
|
set(commandline_option_${name}_variable "${arg_NAME}" PARENT_SCOPE)
|
||||||
endif()
|
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 "")
|
if(NOT "${arg_VALUE}" STREQUAL "")
|
||||||
set(commandline_option_${name}_value "${arg_VALUE}" PARENT_SCOPE)
|
set(commandline_option_${name}_value "${arg_VALUE}" PARENT_SCOPE)
|
||||||
endif()
|
endif()
|
||||||
@ -378,6 +378,23 @@ function(qtConfCommandlineAppendInput name val)
|
|||||||
qtConfCommandlineSetInput(${name} "${val}")
|
qtConfCommandlineSetInput(${name} "${val}")
|
||||||
endfunction()
|
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)
|
function(qtConfValidateValue opt val out_var)
|
||||||
set(${out_var} TRUE PARENT_SCOPE)
|
set(${out_var} TRUE PARENT_SCOPE)
|
||||||
|
|
||||||
@ -753,6 +770,9 @@ get_property(config_inputs GLOBAL PROPERTY CONFIG_INPUTS)
|
|||||||
list(REMOVE_DUPLICATES config_inputs)
|
list(REMOVE_DUPLICATES config_inputs)
|
||||||
foreach(var ${config_inputs})
|
foreach(var ${config_inputs})
|
||||||
get_property(INPUT_${var} GLOBAL PROPERTY INPUT_${var})
|
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()
|
endforeach()
|
||||||
|
|
||||||
macro(drop_input name)
|
macro(drop_input name)
|
||||||
|
@ -145,11 +145,11 @@ function(qt_commandline_cxxstd arg val nextok)
|
|||||||
return()
|
return()
|
||||||
endif()
|
endif()
|
||||||
if(val MATCHES "(c\\+\\+)?(20|2a)")
|
if(val MATCHES "(c\\+\\+)?(20|2a)")
|
||||||
qtConfCommandlineSetInput(c++20 yes)
|
qtConfCommandlineEnableFeature(c++20)
|
||||||
qtConfCommandlineSetInput(c++2b no)
|
qtConfCommandlineDisableFeature(c++2b)
|
||||||
elseif(val MATCHES "(c\\+\\+)?(2b)")
|
elseif(val MATCHES "(c\\+\\+)?(2b)")
|
||||||
qtConfCommandlineSetInput(c++20 yes)
|
qtConfCommandlineEnableFeature(c++20)
|
||||||
qtConfCommandlineSetInput(c++2b yes)
|
qtConfCommandlineEnableFeature(c++2b)
|
||||||
else()
|
else()
|
||||||
qtConfAddError("Invalid argument '${val}' to command line parameter '${arg}'")
|
qtConfAddError("Invalid argument '${val}' to command line parameter '${arg}'")
|
||||||
endif()
|
endif()
|
||||||
@ -164,15 +164,15 @@ function(qt_commandline_sanitize arg val nextok)
|
|||||||
return()
|
return()
|
||||||
endif()
|
endif()
|
||||||
if(val STREQUAL "address")
|
if(val STREQUAL "address")
|
||||||
qtConfCommandlineSetInput(sanitize_address yes)
|
qtConfCommandlineEnableFeature(sanitize_address)
|
||||||
elseif(val STREQUAL "thread")
|
elseif(val STREQUAL "thread")
|
||||||
qtConfCommandlineSetInput(sanitize_thread yes)
|
qtConfCommandlineEnableFeature(sanitize_thread)
|
||||||
elseif(val STREQUAL "memory")
|
elseif(val STREQUAL "memory")
|
||||||
qtConfCommandlineSetInput(sanitize_memory yes)
|
qtConfCommandlineEnableFeature(sanitize_memory)
|
||||||
elseif(val STREQUAL "fuzzer-no-link")
|
elseif(val STREQUAL "fuzzer-no-link")
|
||||||
qtConfCommandlineSetInput(sanitize_fuzzer_no_link yes)
|
qtConfCommandlineEnableFeature(sanitize_fuzzer_no_link)
|
||||||
elseif(val STREQUAL "undefined")
|
elseif(val STREQUAL "undefined")
|
||||||
qtConfCommandlineSetInput(sanitize_undefined yes)
|
qtConfCommandlineEnableFeature(sanitize_undefined)
|
||||||
else()
|
else()
|
||||||
qtConfAddError("Invalid argument '${val}' to command line parameter '${arg}'")
|
qtConfAddError("Invalid argument '${val}' to command line parameter '${arg}'")
|
||||||
endif()
|
endif()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user