From c5578b16d6454e708c8ce12661a85d41eeaaa758 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Mon, 1 Jul 2019 21:18:26 +0200 Subject: 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 Reviewed-by: Ulf Hermann --- tools/qmlcachegen/qtquickcompiler.prf | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tools') 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) -- cgit v1.2.3