Skip to content

Commit 64cc947

Browse files
ossilatorjaheikk
authored andcommitted
automatically launch new configure system in top-level builds
this includes moving the -skip option here, where it belongs. the implementation is a bit hacky, but the proper one would be vastly more complex: we'd have to load all modules, then parse the command line properly (the -skip parsing would be a custom callback, to avoid needing to process features), then discard all now excluded modules again, then re-process the command line (so we can complain about options which are now invalid), and only now proceed with the actual feature processing. that seems a bit over the top, so we accept that -skip cannot be the argument of another option, which seems quite reasonable. Change-Id: I0053658e6d7e11b82cdfe55893cb553b664a9298 Reviewed-by: Jake Petroules <[email protected]> Reviewed-by: Frederik Gladhorn <[email protected]>
1 parent 3e5229c commit 64cc947

File tree

2 files changed

+34
-4
lines changed

2 files changed

+34
-4
lines changed

Diff for: configure.json

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"commandline": {
3+
"options": {
4+
"skip": "addString"
5+
}
6+
}
7+
}

Diff for: qt.pro

+27-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
# Create the super cache so modules will add themselves to it.
22
cache(, super)
33

4-
CONFIG += build_pass # hack to disable the .qmake.super auto-add
5-
load(qt_build_config)
6-
CONFIG -= build_pass # unhack, as it confuses Qt Creator
7-
84
TEMPLATE = subdirs
95

6+
CONFIG += prepare_docs qt_docs_targets
7+
108
# Extract submodules from .gitmodules.
119
lines = $$cat(.gitmodules, lines)
1210
for (line, lines) {
@@ -26,6 +24,29 @@ for (line, lines) {
2624
}
2725
QMAKE_INTERNAL_INCLUDED_FILES += $$PWD/.gitmodules
2826

27+
QT_SKIP_MODULES =
28+
uikit {
29+
QT_SKIP_MODULES += qtdoc qtmacextras qtserialport qtwebkit qtwebkit-examples
30+
!ios: QT_SKIP_MODULES += qtscript
31+
}
32+
33+
# This is a bit hacky, but a proper implementation is not worth it.
34+
args = $$QMAKE_EXTRA_ARGS
35+
for (ever) {
36+
isEmpty(args): break()
37+
a = $$take_first(args)
38+
39+
equals(a, -skip) {
40+
isEmpty(args): break()
41+
m = $$take_first(args)
42+
contains(m, -.*): next()
43+
m ~= s/^(qt)?/qt/
44+
!contains(modules, $$m): \
45+
error("-skip command line argument used with non-existent module '$$m'.")
46+
QT_SKIP_MODULES += $$m
47+
}
48+
}
49+
2950
modules = $$sort_depends(modules, module., .depends .recommends)
3051
modules = $$reverse(modules)
3152
for (mod, modules) {
@@ -72,3 +93,5 @@ for (mod, modules) {
7293

7394
SUBDIRS += $$mod
7495
}
96+
97+
load(qt_configure)

0 commit comments

Comments
 (0)