summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@qt.io>2016-11-23 18:41:48 +0100
committerOswald Buddenhagen <oswald.buddenhagen@qt.io>2016-12-13 18:55:28 +0000
commit24cb1580e2bdb9eace8a419dcc44bffe13ed1550 (patch)
treef67eec3931517a343f22f5b4b7ab74f7b54ca9e4
parent2dcc1a8e4636c754d51370c84a0aa8270e412389 (diff)
make handling of built-in configure options data-driven
Change-Id: I08b226b6c9255b60393734e8ffcb745ccb63c597 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
-rw-r--r--mkspecs/features/configure.prf2
-rw-r--r--mkspecs/features/configure_base.prf2
-rw-r--r--mkspecs/features/data/configure.json21
-rw-r--r--mkspecs/features/qt_configure.prf46
4 files changed, 41 insertions, 30 deletions
diff --git a/mkspecs/features/configure.prf b/mkspecs/features/configure.prf
index 4ca7c6ba07..934a18a924 100644
--- a/mkspecs/features/configure.prf
+++ b/mkspecs/features/configure.prf
@@ -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, "")
diff --git a/mkspecs/features/configure_base.prf b/mkspecs/features/configure_base.prf
index dd1f4e5bfc..41f429e204 100644
--- a/mkspecs/features/configure_base.prf
+++ b/mkspecs/features/configure_base.prf
@@ -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)")
diff --git a/mkspecs/features/data/configure.json b/mkspecs/features/data/configure.json
new file mode 100644
index 0000000000..a937f79b99
--- /dev/null
+++ b/mkspecs/features/data/configure.json
@@ -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" ]
+ }
+ }
+}
diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf
index 7f3f710585..1be92a8b43 100644
--- a/mkspecs/features/qt_configure.prf
+++ b/mkspecs/features/qt_configure.prf
@@ -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