aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--src/qml/compiler/qv4compileddata.cpp7
-rw-r--r--src/qml/qml.pro33
-rw-r--r--src/qmldevtools/qmldevtools.pro1
-rw-r--r--src/src.pro2
5 files changed, 30 insertions, 14 deletions
diff --git a/.gitignore b/.gitignore
index da9552c8e6..2cffe24ff0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -286,6 +286,7 @@ tests/auto/*/*/*/*.moc
src/qml/RegExpJitTables.h
src/qml/udis86_itab.c
src/qml/udis86_itab.h
+src/qml/qml_compile_hash_p.h
# Generated HLSL bytecode headers
*.hlslh
diff --git a/src/qml/compiler/qv4compileddata.cpp b/src/qml/compiler/qv4compileddata.cpp
index 86200d7df7..05869c3287 100644
--- a/src/qml/compiler/qv4compileddata.cpp
+++ b/src/qml/compiler/qv4compileddata.cpp
@@ -65,6 +65,9 @@
#include <QCryptographicHash>
#include <QSaveFile>
+// generated by qmake:
+#include "qml_compile_hash_p.h"
+
#include <algorithm>
#if defined(QT_BUILD_INTERNAL)
@@ -703,10 +706,8 @@ static QByteArray ownLibraryChecksum()
libraryChecksum = hash.result();
}
}
-#elif defined(QML_COMPILE_HASH)
- libraryChecksum = QByteArray(QT_STRINGIFY(QML_COMPILE_HASH));
#else
- // Not implemented.
+ libraryChecksum = QByteArray(QML_COMPILE_HASH);
#endif
return libraryChecksum;
}
diff --git a/src/qml/qml.pro b/src/qml/qml.pro
index acaff08a29..f75bfa0313 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") {
diff --git a/src/qmldevtools/qmldevtools.pro b/src/qmldevtools/qmldevtools.pro
index 5ee97776b8..23b7cf651e 100644
--- a/src/qmldevtools/qmldevtools.pro
+++ b/src/qmldevtools/qmldevtools.pro
@@ -4,6 +4,7 @@ QT = core-private
CONFIG += minimal_syncqt internal_module qmldevtools_build
MODULE_INCNAME = QtQml
+INCLUDEPATH += $$OUT_PWD/../qml
# 2415: variable "xx" of static storage duration was declared but never referenced
# unused variable 'xx' [-Werror,-Wunused-const-variable]
diff --git a/src/src.pro b/src/src.pro
index 33c47048b5..ff0e1e99bc 100644
--- a/src/src.pro
+++ b/src/src.pro
@@ -21,6 +21,8 @@ SUBDIRS += \
imports \
qmldevtools
+qmldevtools.depends = qml
+
qtConfig(qml-network) {
QT_FOR_CONFIG += network
qtConfig(localserver):qtConfig(qml-debug): SUBDIRS += qmldebug