aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2020-10-20 14:47:16 +0200
committerUlf Hermann <ulf.hermann@qt.io>2020-10-23 13:31:19 +0200
commitdb131539058aee18b65110fd2c42698e4894b05e (patch)
tree12614c4b3a69b3683f141c8df06a2528aebe3168 /tools
parent2458f07eb568dc13f1f92b77adc047ef129a5636 (diff)
qmlcachegen: Add empty AOT built functions to the loader
This enables us to use the same generateloader.cpp for qmlcachegen and any replacement that actually produces AOT compiled functions. Change-Id: I12fe81236e4ef16a627729c644d54b6c171b3860 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tools')
-rw-r--r--tools/qmlcachegen/qmlcachegen.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/tools/qmlcachegen/qmlcachegen.cpp b/tools/qmlcachegen/qmlcachegen.cpp
index 33a77bc835..c3ac7d1542 100644
--- a/tools/qmlcachegen/qmlcachegen.cpp
+++ b/tools/qmlcachegen/qmlcachegen.cpp
@@ -386,6 +386,9 @@ static bool saveUnitAsCpp(const QString &inputFileName, const QString &outputFil
if (!writeStr("\n"))
return false;
+ if (!writeStr("#include <QtQml/qqmlprivate.h>\n"))
+ return false;
+
if (!writeStr(QByteArrayLiteral("namespace QmlCacheGeneratedCode {\nnamespace ")))
return false;
@@ -418,7 +421,14 @@ static bool saveUnitAsCpp(const QString &inputFileName, const QString &outputFil
- if (!writeStr("};\n}\n}\n"))
+ if (!writeStr("};\n"))
+ return false;
+
+ if (!writeStr("extern const QQmlPrivate::AOTCompiledFunction aotBuiltFunctions[] = "
+ "{ { 0, QMetaType::fromType<void>(), nullptr } };\n"))
+ return false;
+
+ if (!writeStr("}\n}\n"))
return false;
#if QT_CONFIG(temporaryfile)