summaryrefslogtreecommitdiff
path: root/mkspecs
diff options
context:
space:
mode:
authorDominik Holland <dominik.holland@qt.io>2019-10-23 10:31:14 +0200
committerDominik Holland <dominik.holland@qt.io>2019-10-30 13:25:03 +0100
commitfc77bd2653789dfff2b13512fb6ae8857e269287 (patch)
treebcebcc1e0a46d7e0d2a0c8ea808fc67dce90683b /mkspecs
parent37632e344017c027e627b14eaf2533ebb4b74c45 (diff)
downloadqtivi-fc77bd2653789dfff2b13512fb6ae8857e269287.tar.gz
ivigenerator: Improve build-system integration
Use build-stamps for the ivigenerator run, instead of relying on the generated .pri file. Previously it could have happened that the ivigenerator stoped with an error, but already generated the .pri file. This caused 'make' to stop the build process, but on the next run the ivigenerator wasn't started again as its dependency (the .pri file) was in place and there was no need to generate again. Change-Id: I1e16bde603045625b913303c5cbe549999736abb Reviewed-by: Robert Griebl <robert.griebl@qt.io>
Diffstat (limited to 'mkspecs')
-rw-r--r--mkspecs/features/ivigenerator.prf23
1 files changed, 16 insertions, 7 deletions
diff --git a/mkspecs/features/ivigenerator.prf b/mkspecs/features/ivigenerator.prf
index 93bce6b..ff01a28 100644
--- a/mkspecs/features/ivigenerator.prf
+++ b/mkspecs/features/ivigenerator.prf
@@ -91,15 +91,24 @@ for (IMPORT, QFACE_IMPORT_PATH) {
}
# Windows doesn't offer any other way to sleep for a time inside non-interactive scripts
-equals(QMAKE_HOST.os, Windows): SLEEP = ping -n 2 127.0.0.1 >nul
-else: SLEEP = sleep 1
+equals(QMAKE_HOST.os, Windows): {
+ SLEEP = ping -n 2 127.0.0.1 >nul
+ TOUCH = type nul >
+} else {
+ SLEEP = sleep 1
+ TOUCH = touch
+}
-qface_sources.target = $$relative_path($$PRI, $$OUT_PWD)
-qface_sources.commands = $$SLEEP && $$ENV $$system_path($$IVI_GENERATOR) $$IVI_GENERATOR_OPTIONS $$system_quote($$system_path($$QFACE_ABS_PWD/$${QFACE_FILE})) $$system_quote($$system_path($$QFACE_OUTPUT_DIR))
+qface_sources.target = $$relative_path(.stamp-ivigenerator, $$OUT_PWD)
+qface_sources.commands += $(DEL_FILE) $$system_quote($$system_path($$OUT_PWD/.stamp-ivigenerator)) &&
+qface_sources.commands += $$SLEEP && $$ENV $$system_path($$IVI_GENERATOR) $$IVI_GENERATOR_OPTIONS $$system_quote($$system_path($$QFACE_ABS_PWD/$${QFACE_FILE})) $$system_quote($$system_path($$QFACE_OUTPUT_DIR)) &&
+qface_sources.commands += $$TOUCH $$system_quote($$system_path($$OUT_PWD/.stamp-ivigenerator))
qface_sources.depends = $$IVI_GENERATOR_PATH/generate.py
qface_sources.depends += $$QFACE_ABS_PWD/$${QFACE_FILE}
qface_sources.depends += $$files($$IVI_GENERATOR_PATH/templates/common/*)
+QMAKE_CLEAN += $$relative_path(.stamp-ivigenerator, $$OUT_PWD)
+
# Add all templates of the generator format as dependency
QFACE_TEMPLATE_PWD = $$IVI_GENERATOR_PATH/templates/$${QFACE_FORMAT}
exists($$QFACE_TEMPLATE_PWD) {
@@ -120,14 +129,14 @@ exists($$QFACE_YAML) {
QFACE_HEADERS_OUTPUT_TARGET = $${QFACE_HEADERS_OUTPUT_DIR}/$$lower($${QFACE_MODULE_NAME})module.h
qface_headers.target = $$relative_path($$QFACE_HEADERS_OUTPUT_TARGET, $$OUT_PWD)
qface_headers.commands = $${QMAKE_COPY_FILE} $${QFACE_OUTPUT_DIR}/*.h $${QFACE_HEADERS_OUTPUT_DIR}
- qface_headers.depends = $$relative_path($$PRI, $$OUT_PWD) $$IVI_GENERATOR_PATH/generate.py
+ qface_headers.depends = $$relative_path(.stamp-ivigenerator, $$OUT_PWD) $$IVI_GENERATOR_PATH/generate.py
}
# Reevaluate the Makefile after the generation has finished
Makefile.target = Makefile
# The relative_path is needed here as qmake will use a relative_path for the output files
# when using a QMAKE_EXTRA_COMPILER
-Makefile.depends = $$relative_path($$PRI, $$OUT_PWD)
+Makefile.depends = $$relative_path(.stamp-ivigenerator, $$OUT_PWD)
# Make the qmake_all target work for usage inside QtCreator
# Because of the Makefile target the generator is called before the actual Makefile
@@ -176,7 +185,7 @@ QMAKE_EXTRA_TARGETS += Makefile qface_sources
# Afterwards the sub makefiles are read (Makefile.debug/release), which have been
# regenerated before starting NMAKE on them.
win32-msvc* {
- qmake.depends = $$relative_path($$PRI, $$OUT_PWD)
+ qmake.depends = $$relative_path(.stamp-ivigenerator, $$OUT_PWD)
debug.depends = qmake
debug-make_first.depends = qmake