aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFabian Kosmale <fabian.kosmale@qt.io>2022-02-10 12:09:59 +0100
committerFabian Kosmale <fabian.kosmale@qt.io>2022-02-13 20:01:39 +0100
commit28b32ae449913d079f220110ffa90de9a9ee9784 (patch)
tree9af67a538d87e920c0ceb0c515056c3a4b9884f1 /src
parent98fe8834faaaed65c6c162d0cd2af5609caf14f3 (diff)
Avoid spurious dependency on qml_compile_hash_p.h
The compile hash changes on every commit, so including it in a central header like qv4compileddata_p.h would cause many spurious rebuilds. As we only needed it there for a static assert, we can simply move that check into a source file. Pick-to: 6.2 6.3 Change-Id: I9f24cb3faf5172023b0ece9e6aa07db02638c8be Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/qml/common/qv4compileddata_p.h2
-rw-r--r--src/qml/jsruntime/qv4executablecompilationunit.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/qml/common/qv4compileddata_p.h b/src/qml/common/qv4compileddata_p.h
index 146588b750..2ed7c24efe 100644
--- a/src/qml/common/qv4compileddata_p.h
+++ b/src/qml/common/qv4compileddata_p.h
@@ -67,7 +67,6 @@
#include <private/qendian_p.h>
#include <private/qv4staticvalue_p.h>
-#include <private/qml_compile_hash_p.h>
#include <functional>
#include <limits.h>
@@ -945,7 +944,6 @@ struct QmlUnit
static_assert(sizeof(QmlUnit) == 16, "QmlUnit structure needs to have the expected size to be binary compatible on disk when generated by host compiler and loaded by target");
enum { QmlCompileHashSpace = 48 };
-static_assert(QmlCompileHashSpace > QML_COMPILE_HASH_LENGTH);
static const char magic_str[] = "qv4cdata";
struct Unit
diff --git a/src/qml/jsruntime/qv4executablecompilationunit.cpp b/src/qml/jsruntime/qv4executablecompilationunit.cpp
index 1a5e76cbc9..7c02391a1a 100644
--- a/src/qml/jsruntime/qv4executablecompilationunit.cpp
+++ b/src/qml/jsruntime/qv4executablecompilationunit.cpp
@@ -69,6 +69,8 @@
#include <QtCore/qcryptographichash.h>
#include <QtCore/QScopedValueRollback>
+static_assert(QV4::CompiledData::QmlCompileHashSpace > QML_COMPILE_HASH_LENGTH);
+
#if defined(QML_COMPILE_HASH) && defined(QML_COMPILE_HASH_LENGTH) && QML_COMPILE_HASH_LENGTH > 0
# ifdef Q_OS_LINUX
// Place on a separate section on Linux so it's easier to check from outside