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:
parent
2dcc1a8e46
commit
24cb1580e2
@ -4,6 +4,8 @@ cache()
|
|||||||
|
|
||||||
load(configure_base)
|
load(configure_base)
|
||||||
|
|
||||||
|
isEmpty(QMAKE_CONFIG_VERBOSE): QMAKE_CONFIG_VERBOSE = false
|
||||||
|
|
||||||
QMAKE_CONFIG_LOG = $$dirname(_QMAKE_CACHE_)/config.log
|
QMAKE_CONFIG_LOG = $$dirname(_QMAKE_CACHE_)/config.log
|
||||||
recheck: write_file($$QMAKE_CONFIG_LOG, "")
|
recheck: write_file($$QMAKE_CONFIG_LOG, "")
|
||||||
|
|
||||||
|
@ -22,8 +22,6 @@ QMAKE_MAKE = $$(MAKE)
|
|||||||
# Make sure we don't inherit MAKEFLAGS - -i in particular is fatal.
|
# Make sure we don't inherit MAKEFLAGS - -i in particular is fatal.
|
||||||
QMAKE_MAKE = "$${SETENV_PFX}MAKEFLAGS=$$SETENV_SFX $$QMAKE_MAKE"
|
QMAKE_MAKE = "$${SETENV_PFX}MAKEFLAGS=$$SETENV_SFX $$QMAKE_MAKE"
|
||||||
|
|
||||||
isEmpty(QMAKE_CONFIG_VERBOSE): QMAKE_CONFIG_VERBOSE = false
|
|
||||||
|
|
||||||
defineTest(qtLog) {
|
defineTest(qtLog) {
|
||||||
write_file($$QMAKE_CONFIG_LOG, 1, append)
|
write_file($$QMAKE_CONFIG_LOG, 1, append)
|
||||||
$$QMAKE_CONFIG_VERBOSE: for (l, 1): log("$$l$$escape_expand(\\n)")
|
$$QMAKE_CONFIG_VERBOSE: for (l, 1): log("$$l$$escape_expand(\\n)")
|
||||||
|
21
mkspecs/features/data/configure.json
Normal file
21
mkspecs/features/data/configure.json
Normal 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" ]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -194,29 +194,6 @@ defineTest(qtConfParseCommandLine) {
|
|||||||
c = $$qtConfGetNextCommandlineArg()
|
c = $$qtConfGetNextCommandlineArg()
|
||||||
isEmpty(c): break()
|
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
|
didCustomCall = false
|
||||||
for (customCall, customCalls) {
|
for (customCall, customCalls) {
|
||||||
$${customCall}($$c) {
|
$${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) {
|
defineTest(qtConfProcessOneOutput) {
|
||||||
feature = $${1}
|
feature = $${1}
|
||||||
fpfx = $${currentConfig}.features.$${feature}
|
fpfx = $${currentConfig}.features.$${feature}
|
||||||
@ -1654,7 +1644,7 @@ defineTest(qtConfProcessOutput) {
|
|||||||
module = $$eval($${currentConfig}.module)
|
module = $$eval($${currentConfig}.module)
|
||||||
|
|
||||||
# write it to the output files
|
# write it to the output files
|
||||||
isEmpty($${currentConfig}.files._KEYS_) {
|
!defined($${currentConfig}.files._KEYS_, var) {
|
||||||
# set defaults that should work for most Qt modules
|
# set defaults that should work for most Qt modules
|
||||||
isEmpty(module): \
|
isEmpty(module): \
|
||||||
error("Neither module nor files section specified in configuration file.")
|
error("Neither module nor files section specified in configuration file.")
|
||||||
@ -1727,6 +1717,8 @@ isEmpty(configsToProcess): \
|
|||||||
load(configure_base)
|
load(configure_base)
|
||||||
|
|
||||||
QMAKE_POST_CONFIGURE =
|
QMAKE_POST_CONFIGURE =
|
||||||
|
config.builtins.dir = $$PWD/data
|
||||||
|
configsToProcess = builtins $$configsToProcess
|
||||||
allConfigs =
|
allConfigs =
|
||||||
for(ever) {
|
for(ever) {
|
||||||
isEmpty(configsToProcess): \
|
isEmpty(configsToProcess): \
|
||||||
@ -1760,14 +1752,12 @@ for(ever) {
|
|||||||
for (currentConfig, allConfigs): \
|
for (currentConfig, allConfigs): \
|
||||||
qtConfSetupLibraries()
|
qtConfSetupLibraries()
|
||||||
|
|
||||||
|
qtConfParseCommandLine()
|
||||||
|
|
||||||
!isEmpty(_QMAKE_SUPER_CACHE_): \
|
!isEmpty(_QMAKE_SUPER_CACHE_): \
|
||||||
QMAKE_CONFIG_CACHE = $$dirname(_QMAKE_SUPER_CACHE_)/config.cache
|
QMAKE_CONFIG_CACHE = $$dirname(_QMAKE_SUPER_CACHE_)/config.cache
|
||||||
else: \
|
else: \
|
||||||
QMAKE_CONFIG_CACHE = $$dirname(_QMAKE_CACHE_)/config.cache
|
QMAKE_CONFIG_CACHE = $$dirname(_QMAKE_CACHE_)/config.cache
|
||||||
QMAKE_CONFIG_CACHE_USE = all
|
|
||||||
|
|
||||||
qtConfParseCommandLine()
|
|
||||||
|
|
||||||
!equals(QMAKE_CONFIG_CACHE_USE, none) {
|
!equals(QMAKE_CONFIG_CACHE_USE, none) {
|
||||||
include($$QMAKE_CONFIG_CACHE, , true)
|
include($$QMAKE_CONFIG_CACHE, , true)
|
||||||
# this crudely determines when to discard the cache. this also catches the case
|
# this crudely determines when to discard the cache. this also catches the case
|
||||||
|
Loading…
x
Reference in New Issue
Block a user