Skip to content

Commit

Permalink
automatically launch new configure system in top-level builds
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
ossilator authored and jaheikk committed Sep 15, 2016
1 parent 3e5229c commit 64cc947
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 4 deletions.
7 changes: 7 additions & 0 deletions configure.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"commandline": {
"options": {
"skip": "addString"
}
}
}
31 changes: 27 additions & 4 deletions qt.pro
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
# Create the super cache so modules will add themselves to it.
cache(, super)

CONFIG += build_pass # hack to disable the .qmake.super auto-add
load(qt_build_config)
CONFIG -= build_pass # unhack, as it confuses Qt Creator

TEMPLATE = subdirs

CONFIG += prepare_docs qt_docs_targets

# Extract submodules from .gitmodules.
lines = $$cat(.gitmodules, lines)
for (line, lines) {
Expand All @@ -26,6 +24,29 @@ for (line, lines) {
}
QMAKE_INTERNAL_INCLUDED_FILES += $$PWD/.gitmodules

QT_SKIP_MODULES =
uikit {
QT_SKIP_MODULES += qtdoc qtmacextras qtserialport qtwebkit qtwebkit-examples
!ios: QT_SKIP_MODULES += qtscript
}

# This is a bit hacky, but a proper implementation is not worth it.
args = $$QMAKE_EXTRA_ARGS
for (ever) {
isEmpty(args): break()
a = $$take_first(args)

equals(a, -skip) {
isEmpty(args): break()
m = $$take_first(args)
contains(m, -.*): next()
m ~= s/^(qt)?/qt/
!contains(modules, $$m): \
error("-skip command line argument used with non-existent module '$$m'.")
QT_SKIP_MODULES += $$m
}
}

modules = $$sort_depends(modules, module., .depends .recommends)
modules = $$reverse(modules)
for (mod, modules) {
Expand Down Expand Up @@ -72,3 +93,5 @@ for (mod, modules) {

SUBDIRS += $$mod
}

load(qt_configure)

0 comments on commit 64cc947

Please sign in to comment.