summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@qt.io>2019-07-01 21:18:26 +0200
committerJoerg Bornemann <joerg.bornemann@qt.io>2019-07-03 15:13:51 +0200
commitc5578b16d6454e708c8ce12661a85d41eeaaa758 (patch)
tree4f9ff63d5999724b2d91009d5bdbc1ec9c712e12
parentb79b9e35334b3bdd41329f2ea74bc82f3f05ae52 (diff)
Yield error if qtquickcompiler is used in non-QML projects
Consider a non-QML project that puts .js files in a Qt resource file. The qtquickcompiler feature will pull those files out of the resource and generate QML-specific code, which will lead to build errors. Yield an error message on qmake-time. Fixes: QTBUG-73669 Change-Id: I6bec22f758d884ce4e1c50fca48f452c5f86ce74 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
-rw-r--r--tools/qmlcachegen/qtquickcompiler.prf10
1 files changed, 10 insertions, 0 deletions
diff --git a/tools/qmlcachegen/qtquickcompiler.prf b/tools/qmlcachegen/qtquickcompiler.prf
index b98d8a0198..967d55a5bd 100644
--- a/tools/qmlcachegen/qtquickcompiler.prf
+++ b/tools/qmlcachegen/qtquickcompiler.prf
@@ -1,5 +1,15 @@
if(qtc_run|lupdate_run): return()
+!contains(QT, qml) {
+ qt_modules = \
+ $$replace(QT, -private$, _private) \
+ $$replace(QT_PRIVATE, -private$, _private)
+ qt_modules = $$resolve_depends(qt_modules, "QT.", ".depends" ".run_depends")
+ !contains(qt_modules, qml): \
+ error("The qtquickcompiler feature cannot be used without the QML module.")
+ unset(qt_modules)
+}
+
qtPrepareTool(QML_CACHEGEN, qmlcachegen, _FILTER)
qtPrepareTool(QMAKE_RCC, rcc, _DEP)