aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml.pro
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2018-02-22 09:19:15 +0100
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2018-02-22 09:19:15 +0100
commitd21fd0662782a5fc4c01a5544f0064c9f0f121dc (patch)
tree49fb1e7481ec9f17381be492fede3f9097c7895d /src/qml/qml.pro
parent759cdce3e6d22995106cfec0f1e6c6cbd3fdf266 (diff)
parentab03ee7b7e12ae64556513e4791b0d4d55ea26c4 (diff)
Merge remote-tracking branch 'origin/5.11' into dev
Diffstat (limited to 'src/qml/qml.pro')
-rw-r--r--src/qml/qml.pro33
1 files changed, 22 insertions, 11 deletions
diff --git a/src/qml/qml.pro b/src/qml/qml.pro
index adfaf38e9f..eabca59836 100644
--- a/src/qml/qml.pro
+++ b/src/qml/qml.pro
@@ -16,17 +16,28 @@ gcc:isEqual(QT_ARCH, "mips"): QMAKE_CXXFLAGS += -fno-reorder-blocks
DEFINES += QT_NO_FOREACH
-tagFile=$$PWD/../../.tag
-tag=
-exists($$tagFile) {
- tag=$$cat($$tagFile, singleline)
- QMAKE_INTERNAL_INCLUDED_FILES += $$tagFile
-}
-!equals(tag, "$${LITERAL_DOLLAR}Format:%H$${LITERAL_DOLLAR}") {
- DEFINES += QML_COMPILE_HASH="$$tag"
-} else:exists($$PWD/../../.git) {
- commit=$$system(git describe --tags --always --long --dirty)
- DEFINES += QML_COMPILE_HASH="$$commit"
+!build_pass {
+ # Create a header containing a hash that describes this library. For a
+ # released version of Qt, we'll use the .tag file that is updated by git
+ # archive with the commit hash. For unreleased versions, we'll ask git
+ # describe. Note that it won't update unless qmake is run again, even if
+ # the commit change also changed something in this library.
+ tagFile = $$PWD/../../.tag
+ tag =
+ exists($$tagFile) {
+ tag = $$cat($$tagFile, singleline)
+ QMAKE_INTERNAL_INCLUDED_FILES += $$tagFile
+ }
+ !equals(tag, "$${LITERAL_DOLLAR}Format:%H$${LITERAL_DOLLAR}") {
+ QML_COMPILE_HASH = $$tag
+ } else:exists($$PWD/../../.git) {
+ commit = $$system(git describe --tags --always --long --dirty)
+ QML_COMPILE_HASH = $$commit
+ }
+ compile_hash_contents = \
+ "// Generated file, DO NOT EDIT" \
+ "$${LITERAL_HASH}define QML_COMPILE_HASH \"$$QML_COMPILE_HASH\""
+ write_file("$$OUT_PWD/qml_compile_hash_p.h", compile_hash_contents)|error()
}
exists("qqml_enable_gcov") {