From db131539058aee18b65110fd2c42698e4894b05e Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Tue, 20 Oct 2020 14:47:16 +0200 Subject: 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 --- tools/qmlcachegen/qmlcachegen.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'tools') 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 \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(), nullptr } };\n")) + return false; + + if (!writeStr("}\n}\n")) return false; #if QT_CONFIG(temporaryfile) -- cgit v1.2.3