From 9aba23c99ed59765a6991089c05c98f35e549c51 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Tue, 1 Dec 2020 14:33:13 +0100 Subject: Allow passing --qmljs-runtime to the qmlcachegen implementation This signals qmlcachegenplus to not paste the whole JavaScript type system into each generated file. In turn, user projects need to add a dependency in order to build against the JS runtime. qmlcachegen ignores the option. Change-Id: I0f87dedb969e99e94fbb712b7faa23d84f76dfbe Reviewed-by: Fabian Kosmale Reviewed-by: Alexandru Croitor --- src/qml/Qt6QmlMacros.cmake | 5 +++++ tools/qmlcachegen/qmlcachegen.cpp | 2 ++ 2 files changed, 7 insertions(+) diff --git a/src/qml/Qt6QmlMacros.cmake b/src/qml/Qt6QmlMacros.cmake index 3f23a4f63d..9d17dfd501 100644 --- a/src/qml/Qt6QmlMacros.cmake +++ b/src/qml/Qt6QmlMacros.cmake @@ -947,6 +947,11 @@ function(_qt_internal_quick_compiler_process_resources target resource_name) list(APPEND qmlcachegen_extra_args "--direct-calls") endif() + get_target_property(qmljs_runtime ${target} QT_QMLCACHEGEN_QMLJS_RUNTIME) + if (qmljs_runtime) + list(APPEND qmlcachegen_extra_args "--qmljs-runtime") + endif() + foreach(file IN LISTS qml_files) get_filename_component(file_absolute ${file} ABSOLUTE) file(RELATIVE_PATH file_relative ${CMAKE_CURRENT_SOURCE_DIR} ${file_absolute}) diff --git a/tools/qmlcachegen/qmlcachegen.cpp b/tools/qmlcachegen/qmlcachegen.cpp index e4077f0831..c56b647c9a 100644 --- a/tools/qmlcachegen/qmlcachegen.cpp +++ b/tools/qmlcachegen/qmlcachegen.cpp @@ -105,6 +105,8 @@ int main(int argc, char **argv) parser.addOption(resourceNameOption); QCommandLineOption directCallsOption(QStringLiteral("direct-calls"), QCoreApplication::translate("main", "This option is ignored.")); parser.addOption(directCallsOption); + QCommandLineOption qmlJSRuntimeOption(QStringLiteral("qmljs-runtime"), QCoreApplication::translate("main", "This option is ignored.")); + parser.addOption(qmlJSRuntimeOption); QCommandLineOption outputFileOption(QStringLiteral("o"), QCoreApplication::translate("main", "Output file name"), QCoreApplication::translate("main", "file name")); parser.addOption(outputFileOption); -- cgit v1.2.3