aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/doc
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2021-11-23 19:00:29 +0100
committerUlf Hermann <ulf.hermann@qt.io>2021-12-03 12:09:26 +0100
commit58ff7aa4fed5b3a27b6a859fc02f9ee27dd1a6cc (patch)
treecd8d455066d5e9e6d14988e945f4ba421765b743 /src/qml/doc
parentc2f50cf90d143d96313ab3cfdbb9e4552a095cbb (diff)
Compile QML files ahead of time with qmlcachegen
qmlcachegen compiles bindings and functions to C++ as far as QQmlJSAotCompiler can. It does respect "pragma Strict" and rejects the file if it's violated. Furthermore, it sets up the logger to follow the qt.qml.compiler.aot logging category. By default it's completely silent. Compiling the examples with qmlcachegen exposes a bug in the type resolver where it returns an invalid generic type. It should never do that. Fix it by returning JSValue. [ChangeLog][QtQml][Important Behavior Changes] QML bindings and functions are now compiled to C++ by qmlcachegen, if possible. Use the qt.qml.compiler.aot logging category to receive diagnostics about the compilation. Task-number: QTBUG-98305 Change-Id: I6953812c3fd20b68339617a5714fcbe16a384360 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/doc')
-rw-r--r--src/qml/doc/src/cmake/qt_add_qml_module.qdoc10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/qml/doc/src/cmake/qt_add_qml_module.qdoc b/src/qml/doc/src/cmake/qt_add_qml_module.qdoc
index f7690e89d6..49d85f8f42 100644
--- a/src/qml/doc/src/cmake/qt_add_qml_module.qdoc
+++ b/src/qml/doc/src/cmake/qt_add_qml_module.qdoc
@@ -259,6 +259,16 @@ set_target_properties(someTarget PROPERTIES
This explicitly selects qmlcachegen as the program to be used, even if
better alternatives are available.
+Furthermore, you can pass extra arguments to qmlcachegen, by setting the
+\c QT_QMLCACHEGEN_ARGUMENTS option. In particular, the \c --only-bytecode
+option will turn off compilation of QML script code to C++. For example:
+
+\badcode
+set_target_properties(someTarget PROPERTIES
+ QT_QMLCACHEGEN_ARGUMENTS "--only-bytecode"
+)
+\endcode
+
\target qmllint-auto
\section2 Linting QML sources