make handling of built-in configure options data-driven

Change-Id: I08b226b6c9255b60393734e8ffcb745ccb63c597
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
This commit is contained in:
Oswald Buddenhagen 2016-11-23 18:41:48 +01:00
parent 2dcc1a8e46
commit 24cb1580e2
4 changed files with 41 additions and 30 deletions

View File

@ -4,6 +4,8 @@ cache()
load(configure_base)
isEmpty(QMAKE_CONFIG_VERBOSE): QMAKE_CONFIG_VERBOSE = false
QMAKE_CONFIG_LOG = $$dirname(_QMAKE_CACHE_)/config.log
recheck: write_file($$QMAKE_CONFIG_LOG, "")

View File

@ -22,8 +22,6 @@ QMAKE_MAKE = $$(MAKE)
# Make sure we don't inherit MAKEFLAGS - -i in particular is fatal.
QMAKE_MAKE = "$${SETENV_PFX}MAKEFLAGS=$$SETENV_SFX $$QMAKE_MAKE"
isEmpty(QMAKE_CONFIG_VERBOSE): QMAKE_CONFIG_VERBOSE = false
defineTest(qtLog) {
write_file($$QMAKE_CONFIG_LOG, 1, append)
$$QMAKE_CONFIG_VERBOSE: for (l, 1): log("$$l$$escape_expand(\\n)")

View File

@ -0,0 +1,21 @@
{
"files": {
},
"commandline": {
"options": {
"v": { "type": "enum", "name": "verbose", "values": { "yes": "true", "no": "false" } },
"verbose": { "type": "enum", "values": { "yes": "true", "no": "false" } },
"recheck": { "type": "void", "name": "cache_use", "value": "positive" },
"recheck-all": { "type": "void", "name": "cache_use", "value": "none" },
}
},
"features": {
"builtins": {
"output": [ "builtins" ]
}
}
}

View File

@ -194,29 +194,6 @@ defineTest(qtConfParseCommandLine) {
c = $$qtConfGetNextCommandlineArg()
isEmpty(c): break()
# handle options to turn on verbose logging
contains(c, "^-v")|contains(c, "^--?verbose") {
QMAKE_CONFIG_VERBOSE = true
export(QMAKE_CONFIG_VERBOSE)
next()
}
contains(c, "^-no-v")|contains(c, "^--?no-verbose") {
QMAKE_CONFIG_VERBOSE = false
export(QMAKE_CONFIG_VERBOSE)
next()
}
contains(c, "^--?recheck") {
QMAKE_CONFIG_CACHE_USE = positive
export(QMAKE_CONFIG_CACHE_USE)
next()
}
contains(c, "^--?recheck-all") {
QMAKE_CONFIG_CACHE_USE = none
export(QMAKE_CONFIG_CACHE_USE)
next()
}
didCustomCall = false
for (customCall, customCalls) {
$${customCall}($$c) {
@ -1619,6 +1596,19 @@ defineTest(qtConfOutput_privateFeature) {
}
}
# command line built-ins post-processing
defineTest(qtConfOutput_builtins) {
QMAKE_CONFIG_VERBOSE = $$eval(config.input.verbose)
isEmpty(QMAKE_CONFIG_VERBOSE): \
QMAKE_CONFIG_VERBOSE = false
export(QMAKE_CONFIG_VERBOSE)
QMAKE_CONFIG_CACHE_USE = $$eval(config.input.cache_use)
isEmpty(QMAKE_CONFIG_CACHE_USE): \
QMAKE_CONFIG_CACHE_USE = all
export(QMAKE_CONFIG_CACHE_USE)
}
defineTest(qtConfProcessOneOutput) {
feature = $${1}
fpfx = $${currentConfig}.features.$${feature}
@ -1654,7 +1644,7 @@ defineTest(qtConfProcessOutput) {
module = $$eval($${currentConfig}.module)
# write it to the output files
isEmpty($${currentConfig}.files._KEYS_) {
!defined($${currentConfig}.files._KEYS_, var) {
# set defaults that should work for most Qt modules
isEmpty(module): \
error("Neither module nor files section specified in configuration file.")
@ -1727,6 +1717,8 @@ isEmpty(configsToProcess): \
load(configure_base)
QMAKE_POST_CONFIGURE =
config.builtins.dir = $$PWD/data
configsToProcess = builtins $$configsToProcess
allConfigs =
for(ever) {
isEmpty(configsToProcess): \
@ -1760,14 +1752,12 @@ for(ever) {
for (currentConfig, allConfigs): \
qtConfSetupLibraries()
qtConfParseCommandLine()
!isEmpty(_QMAKE_SUPER_CACHE_): \
QMAKE_CONFIG_CACHE = $$dirname(_QMAKE_SUPER_CACHE_)/config.cache
else: \
QMAKE_CONFIG_CACHE = $$dirname(_QMAKE_CACHE_)/config.cache
QMAKE_CONFIG_CACHE_USE = all
qtConfParseCommandLine()
!equals(QMAKE_CONFIG_CACHE_USE, none) {
include($$QMAKE_CONFIG_CACHE, , true)
# this crudely determines when to discard the cache. this also catches the case