error-check dependency declarations
authorOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Tue, 17 Nov 2015 13:07:18 +0000 (14:07 +0100)
committerSimon Hausmann <simon.hausmann@theqtcompany.com>
Tue, 1 Dec 2015 14:00:46 +0000 (14:00 +0000)
Change-Id: I98ad68d8be608b144c5f2ff422aaf7baab9907e8
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
qt.pro

diff --git a/qt.pro b/qt.pro
index f127480..be193c5 100644 (file)
--- a/qt.pro
+++ b/qt.pro
@@ -13,6 +13,12 @@ defineReplace(moduleName) {
 
 # 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)
+
     contains(QT_SKIP_MODULES, $$1): return(false)
     !isEmpty(QT_BUILD_MODULES):!contains(QT_BUILD_MODULES, $$1): return(false)
     mod = $$moduleName($$1)