aboutsummaryrefslogtreecommitdiffstats
path: root/tools/qmlcachegen/qmlcache.prf
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@qt.io>2017-03-03 10:35:13 +0100
committerSimon Hausmann <simon.hausmann@qt.io>2017-03-07 07:06:44 +0000
commitba6de61acd3129ad1435f6bca7f564385212f95c (patch)
tree3f982a8f7344e215166aa6e79a8c95ca9e4c8c43 /tools/qmlcachegen/qmlcache.prf
parent1102f6ca7f1bb09e77f100b7e2afcac9f13e322c (diff)
Fix skipping of qml cache generation on unsupported architectures
Detect support for the target architecture at qmake time and gently skip the process. Change-Id: I7cc22a0cfb9a8b503c182062a56e506035f84fa2 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'tools/qmlcachegen/qmlcache.prf')
-rw-r--r--tools/qmlcachegen/qmlcache.prf16
1 files changed, 14 insertions, 2 deletions
diff --git a/tools/qmlcachegen/qmlcache.prf b/tools/qmlcachegen/qmlcache.prf
index e0c62ec4d3..5cac5592c3 100644
--- a/tools/qmlcachegen/qmlcache.prf
+++ b/tools/qmlcachegen/qmlcache.prf
@@ -1,10 +1,22 @@
-qtPrepareTool(QML_CACHEGEN, qmlcachegen)
+static {
+ message("QML cache generation ahead of time is not supported in static builds")
+ return()
+}
+
+qtPrepareTool(QML_CACHEGEN, qmlcachegen, _ARCH_CHECK)
isEmpty(TARGETPATH): error("Must set TARGETPATH (QML import name) for ahead-of-time QML cache generation")
!isEmpty(QT_TARGET_ARCH):QML_CACHEGEN_ARCH=$$QT_TARGET_ARCH
else:QML_CACHEGEN_ARCH=$$QT_ARCH
+QML_CACHEGEN_ARGS=--target-architecture=$$QML_CACHEGEN_ARCH
+
+!system($$QML_CACHEGEN_ARCH_CHECK $$QML_CACHEGEN_ARGS --check-if-supported) {
+ message("QML cache generation requested but target architecture $$QML_CACHEGEN_ARCH is not supported.")
+ return()
+}
+
CACHEGEN_FILES=
for(qmlf, QML_FILES) {
contains(qmlf,.*\\.js$)|contains(qmlf,.*\\.qml$) {
@@ -19,7 +31,7 @@ prefix_build {
qmlcachegen.output = $$[QT_INSTALL_QML]/$$TARGETPATH/${QMAKE_FILE_IN}c
qmlcachegen.CONFIG = no_link target_predeps
}
-qmlcachegen.commands = $$QML_CACHEGEN --target-architecture=$$QML_CACHEGEN_ARCH -o ${QMAKE_FILE_OUT} ${QMAKE_FILE_IN}
+qmlcachegen.commands = $$QML_CACHEGEN $$QML_CACHEGEN_ARGS -o ${QMAKE_FILE_OUT} ${QMAKE_FILE_IN}
qmlcachegen.name = Generate QML Cache ${QMAKE_FILE_IN}
qmlcachegen.variable_out = GENERATED_FILES