summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>2015-12-18 18:50:54 +0100
committerJani Heikkinen <jani.heikkinen@theqtcompany.com>2016-01-22 04:26:12 +0000
commit06c3d40cc90ae33a4d06b3dc21b9c0f23ad00c35 (patch)
tree037bf84fa19e76aad707f89e8447550562519121
parentf47e82703c80504304dd18335d669852e72be09f (diff)
move module dependencies from qt.pro to .gitmodules
this removes the last redundant module list. the module build order which is not determined by dependencies is pretty random now. this is avoided for a few heavy and "less relevant" modules by setting a priority to built them as late as possible. Change-Id: Ie8ef9777d050a4915cd2282dc9ccb48fcdbc02d2 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
-rw-r--r--.gitattributes1
-rw-r--r--.gitmodules65
-rw-r--r--qt.pro133
3 files changed, 117 insertions, 82 deletions
diff --git a/.gitattributes b/.gitattributes
index df15048e..084cdfd6 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1,7 +1,6 @@
.tag export-subst
.gitignore export-ignore
.gitattributes export-ignore
-.gitmodules export-ignore
.commit-template export-ignore
init-repository export-ignore
README.git export-ignore
diff --git a/.gitmodules b/.gitmodules
index 211c331c..49c27df9 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -4,193 +4,258 @@
branch = 5.6
initrepo = true
[submodule "qtsvg"]
+ depends = qtbase
path = qtsvg
url = ../qtsvg.git
branch = 5.6
initrepo = true
[submodule "qtdeclarative"]
+ depends = qtbase
+ recommends = qtsvg qtxmlpatterns
path = qtdeclarative
url = ../qtdeclarative.git
branch = 5.6
initrepo = true
[submodule "qtactiveqt"]
+ depends = qtbase
path = qtactiveqt
url = ../qtactiveqt.git
branch = 5.6
initrepo = true
[submodule "qtscript"]
+ depends = qtbase
+ recommends = qttools
path = qtscript
url = ../qtscript.git
branch = 5.6
initrepo = true
[submodule "qtmultimedia"]
+ depends = qtbase
+ recommends = qtdeclarative
path = qtmultimedia
url = ../qtmultimedia.git
branch = 5.6
initrepo = true
[submodule "qttools"]
+ depends = qtbase
+ recommends = qtdeclarative qtactiveqt qtwebkit
path = qttools
url = ../qttools.git
branch = 5.6
initrepo = true
[submodule "qtxmlpatterns"]
+ depends = qtbase
path = qtxmlpatterns
url = ../qtxmlpatterns.git
branch = 5.6
initrepo = true
[submodule "qttranslations"]
+ depends = qttools
path = qttranslations
url = ../qttranslations.git
branch = 5.6
initrepo = true
+ priority = 30
[submodule "qtdoc"]
+ depends = qtdeclarative
path = qtdoc
url = ../qtdoc.git
branch = 5.6
initrepo = true
+ priority = 40
[submodule "qtrepotools"]
path = qtrepotools
url = ../qtrepotools.git
branch = master
initrepo = true
+ qt = false
[submodule "qtwebkit"]
+ depends = qtbase
+ recommends = qtdeclarative qtlocation qtmultimedia qtsensors qtwebchannel qtxmlpatterns
path = qtwebkit
url = ../qtwebkit.git
branch = 5.6
+ project = WebKit.pro
+ priority = 20
[submodule "qtwebkit-examples"]
+ depends = qtwebkit qttools
path = qtwebkit-examples
url = ../qtwebkit-examples.git
branch = 5.6
[submodule "qtqa"]
+ depends = qtbase
path = qtqa
url = ../qtqa.git
branch = master
initrepo = true
+ priority = 50
[submodule "qtlocation"]
+ depends = qtbase
+ recommends = qtdeclarative qtquickcontrols qtserialport qtsystems
path = qtlocation
url = ../qtlocation.git
branch = 5.6
initrepo = true
[submodule "qtsensors"]
+ depends = qtbase
+ recommends = qtdeclarative
path = qtsensors
url = ../qtsensors.git
branch = 5.6
initrepo = true
[submodule "qtsystems"]
+ depends = qtbase
+ recommends = qtdeclarative
path = qtsystems
url = ../qtsystems.git
branch = dev
[submodule "qtfeedback"]
+ depends = qtdeclarative
+ recommends = qtmultimedia
path = qtfeedback
url = ../qtfeedback.git
branch = master
[submodule "qtdocgallery"]
+ depends = qtdeclarative
path = qtdocgallery
url = ../qtdocgallery.git
branch = master
[submodule "qtpim"]
+ depends = qtdeclarative
path = qtpim
url = ../qtpim.git
branch = dev
[submodule "qtconnectivity"]
+ depends = qtbase
+ recommends = qtdeclarative qtandroidextras
path = qtconnectivity
url = ../qtconnectivity.git
branch = 5.6
initrepo = true
[submodule "qtwayland"]
+ depends = qtbase
+ recommends = qtdeclarative
path = qtwayland
url = ../qtwayland.git
branch = 5.6
initrepo = true
[submodule "qt3d"]
+ depends = qtdeclarative qtimageformats
path = qt3d
url = ../qt3d.git
branch = 5.6
initrepo = true
[submodule "qtimageformats"]
+ depends = qtbase
path = qtimageformats
url = ../qtimageformats.git
branch = 5.6
initrepo = true
[submodule "qtquick1"]
+ depends = qtscript
+ recommends = qtsvg qtxmlpatterns
path = qtquick1
url = ../qtquick1.git
branch = 5.6
[submodule "qtgraphicaleffects"]
+ depends = qtdeclarative
path = qtgraphicaleffects
url = ../qtgraphicaleffects.git
branch = 5.6
initrepo = true
[submodule "qtquickcontrols"]
+ depends = qtdeclarative
+ recommends = qtgraphicaleffects
path = qtquickcontrols
url = ../qtquickcontrols.git
branch = 5.6
initrepo = true
[submodule "qtserialbus"]
+ depends = qtserialport
path = qtserialbus
url = ../qtserialbus.git
branch = 5.6
[submodule "qtserialport"]
+ depends = qtbase
path = qtserialport
url = ../qtserialport.git
branch = 5.6
initrepo = true
[submodule "qtx11extras"]
+ depends = qtbase
path = qtx11extras
url = ../qtx11extras.git
branch = 5.6
initrepo = true
[submodule "qtmacextras"]
+ depends = qtbase
path = qtmacextras
url = ../qtmacextras.git
branch = 5.6
initrepo = true
[submodule "qtwinextras"]
+ depends = qtbase
+ recommends = qtdeclarative qtmultimedia
path = qtwinextras
url = ../qtwinextras.git
branch = 5.6
initrepo = true
[submodule "qtandroidextras"]
+ depends = qtbase
path = qtandroidextras
url = ../qtandroidextras.git
branch = 5.6
initrepo = true
[submodule "qtenginio"]
+ depends = qtdeclarative
path = qtenginio
url = ../qtenginio.git
branch = 5.6
initrepo = true
[submodule "qtwebsockets"]
+ depends = qtbase
+ recommends = qtdeclarative
path = qtwebsockets
url = ../qtwebsockets.git
branch = 5.6
initrepo = true
[submodule "qtwebchannel"]
+ depends = qtbase
+ recommends = qtdeclarative qtwebsockets
path = qtwebchannel
url = ../qtwebchannel.git
branch = 5.6
initrepo = true
[submodule "qtwebengine"]
+ depends = qtquickcontrols qtwebchannel
+ recommends = qtlocation
path = qtwebengine
url = ../qtwebengine.git
branch = 5.6
initrepo = true
+ priority = 10
[submodule "qtcanvas3d"]
+ depends = qtdeclarative
path = qtcanvas3d
url = ../qtcanvas3d.git
branch = 5.6
initrepo = true
[submodule "qtwebview"]
+ depends = qtdeclarative
+ recommends = qtwebengine
path = qtwebview
url = ../qtwebview.git
branch = 5.6
initrepo = true
[submodule "qtquickcontrols2"]
+ depends = qtquickcontrols
path = qtquickcontrols2
url = ../qtquickcontrols2.git
branch = 5.6
initrepo = true
[submodule "qtpurchasing"]
+ depends = qtbase
+ recommends = qtdeclarative
path = qtpurchasing
url = ../qtpurchasing.git
branch = 5.6
diff --git a/qt.pro b/qt.pro
index 5e168fae..f8d3d4d3 100644
--- a/qt.pro
+++ b/qt.pro
@@ -7,97 +7,68 @@ CONFIG -= build_pass # unhack, as it confuses Qt Creator
TEMPLATE = subdirs
-defineReplace(moduleName) {
- return(module_$$replace(1, -, _))
+# Extract submodules from .gitmodules.
+lines = $$cat(.gitmodules, lines)
+for (line, lines) {
+ mod = $$replace(line, "^\\[submodule \"([^\"]+)\"\\]$", \\1)
+ !equals(mod, $$line) {
+ module = $$mod
+ modules += $$mod
+ } else {
+ prop = $$replace(line, "^$$escape_expand(\\t)([^ =]+) *=.*$", \\1)
+ !equals(prop, $$line) {
+ val = $$replace(line, "^[^=]+= *", )
+ module.$${module}.$$prop = $$split(val)
+ } else {
+ error("Malformed line in .gitmodules: $$line")
+ }
+ }
}
+QMAKE_INTERNAL_INCLUDED_FILES += $$PWD/.gitmodules
+
+modules = $$sort_depends(modules, module., .depends .recommends)
+modules = $$reverse(modules)
+for (mod, modules) {
+ equals(module.$${mod}.qt, false): \
+ next()
-# Arguments: module name, [mandatory deps], [optional deps], [project file]
-defineTest(addModule) {
- for(d, $$list($$2 $$3)): \
- !contains(MODULES, $$d): \
- error("'$$1' depends on not (yet) declared '$$d'.")
- MODULES += $$1
- export(MODULES)
+ deps = $$eval(module.$${mod}.depends)
+ recs = $$eval(module.$${mod}.recommends)
+ for (d, $$list($$deps $$recs)): \
+ !contains(modules, $$d): \
+ error("'$$mod' depends on undeclared '$$d'.")
- contains(QT_SKIP_MODULES, $$1): return(false)
- !isEmpty(QT_BUILD_MODULES):!contains(QT_BUILD_MODULES, $$1): return(false)
- mod = $$moduleName($$1)
+ contains(QT_SKIP_MODULES, $$mod): \
+ next()
+ !isEmpty(QT_BUILD_MODULES):!contains(QT_BUILD_MODULES, $$mod): \
+ next()
- isEmpty(4) {
- !exists($$1/$${1}.pro): return(false)
- $${mod}.subdir = $$1
- export($${mod}.subdir)
+ project = $$eval(module.$${mod}.project)
+ isEmpty(project) {
+ !exists($$mod/$${mod}.pro): \
+ next()
+ $${mod}.subdir = $$mod
} else {
- !exists($$1/$${4}): return(false)
- $${mod}.file = $$1/$$4
+ !exists($$mod/$$project): \
+ next()
+ $${mod}.file = $$mod/$$project
$${mod}.makefile = Makefile
- export($${mod}.file)
- export($${mod}.makefile)
}
+ $${mod}.target = module-$$mod
- for(d, 2) {
- dn = $$moduleName($$d)
- !contains(SUBDIRS, $$dn): \
- return(false)
- $${mod}.depends += $$dn
+ for (d, deps) {
+ !contains(SUBDIRS, $$d) {
+ $${mod}.target =
+ break()
+ }
+ $${mod}.depends += $$d
}
- for(d, 3) {
- dn = $$moduleName($$d)
- contains(SUBDIRS, $$dn): \
- $${mod}.depends += $$dn
+ isEmpty($${mod}.target): \
+ next()
+ for (d, recs) {
+ contains(SUBDIRS, $$d): \
+ $${mod}.depends += $$d
}
- !isEmpty($${mod}.depends): \
- export($${mod}.depends)
-
- $${mod}.target = module-$$1
- export($${mod}.target)
SUBDIRS += $$mod
- export(SUBDIRS)
- return(true)
}
-
-# only qtbase is required to exist. The others may not - but it is the
-# users responsibility to ensure that all needed dependencies exist, or
-# it may not build.
-
-addModule(qtbase)
-addModule(qtandroidextras, qtbase)
-addModule(qtmacextras, qtbase)
-addModule(qtx11extras, qtbase)
-addModule(qtsvg, qtbase)
-addModule(qtxmlpatterns, qtbase)
-addModule(qtdeclarative, qtbase, qtsvg qtxmlpatterns)
-addModule(qtgraphicaleffects, qtdeclarative)
-addModule(qtquickcontrols, qtdeclarative, qtgraphicaleffects)
-addModule(qtquickcontrols2, qtquickcontrols)
-addModule(qtmultimedia, qtbase, qtdeclarative)
-addModule(qtwinextras, qtbase, qtdeclarative qtmultimedia)
-addModule(qtactiveqt, qtbase)
-addModule(qtsystems, qtbase, qtdeclarative)
-addModule(qtsensors, qtbase, qtdeclarative)
-addModule(qtconnectivity, qtbase, qtdeclarative qtandroidextras)
-addModule(qtfeedback, qtdeclarative, qtmultimedia)
-addModule(qtpim, qtdeclarative)
-addModule(qtwebsockets, qtbase, qtdeclarative)
-addModule(qtwebchannel, qtbase, qtdeclarative qtwebsockets)
-addModule(qtserialport, qtbase)
-addModule(qtlocation, qtbase, qtdeclarative qtquickcontrols qtserialport qtsystems)
-addModule(qtwebkit, qtbase, qtdeclarative qtlocation qtmultimedia qtsensors qtwebchannel qtxmlpatterns, WebKit.pro)
-addModule(qttools, qtbase, qtdeclarative qtactiveqt qtwebkit)
-addModule(qtwebkit-examples, qtwebkit qttools)
-addModule(qtimageformats, qtbase)
-addModule(qt3d, qtdeclarative qtimageformats)
-addModule(qtcanvas3d, qtdeclarative)
-addModule(qtscript, qtbase, qttools)
-addModule(qtquick1, qtscript, qtsvg qtxmlpatterns)
-addModule(qtdocgallery, qtdeclarative)
-addModule(qtwayland, qtbase, qtdeclarative)
-addModule(qtserialbus, qtserialport)
-addModule(qtenginio, qtdeclarative)
-addModule(qtwebengine, qtquickcontrols qtwebchannel, qtlocation)
-addModule(qtwebview, qtdeclarative, qtwebengine)
-addModule(qtpurchasing, qtbase, qtdeclarative)
-addModule(qttranslations, qttools)
-addModule(qtdoc, qtdeclarative)
-addModule(qtqa, qtbase)