aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/Qt6QmlBuildInternals.cmake
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2020-06-02 16:50:20 +0200
committerUlf Hermann <ulf.hermann@qt.io>2020-06-09 08:01:02 +0200
commit5dc14c88f9510795835fb4f0a0d46d67c40f7020 (patch)
tree937173d548a6ad0d4c46cf75914adb6f6b140254 /src/qml/Qt6QmlBuildInternals.cmake
parent6a48a81319b886c8a3f85e1eb024186b05d0f3af (diff)
Allow QML plugins to be optional
If a plugin does nothing but load the library that provides the types, we can skip the plugin loading by linking the library directly. State that in the qmldir file, and evaluate it when loading the module. Task-number: QTBUG-84639 Change-Id: I2097237866a50f66c55e4653ad119fe10e18a893 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/Qt6QmlBuildInternals.cmake')
-rw-r--r--src/qml/Qt6QmlBuildInternals.cmake7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/qml/Qt6QmlBuildInternals.cmake b/src/qml/Qt6QmlBuildInternals.cmake
index 7ef66ce766..aeec04e810 100644
--- a/src/qml/Qt6QmlBuildInternals.cmake
+++ b/src/qml/Qt6QmlBuildInternals.cmake
@@ -17,6 +17,7 @@ include_guard(GLOBAL)
# VERSION: Version of the qml module
# SKIP_TYPE_REGISTRATION: All qml files are expected to be registered by the
# c++ plugin code.
+# PLUGIN_OPTIONAL: Any plugins are optional
#
function(qt_add_qml_module target)
@@ -25,6 +26,7 @@ function(qt_add_qml_module target)
DESIGNER_SUPPORTED
DO_NOT_INSTALL
SKIP_TYPE_REGISTRATION
+ PLUGIN_OPTIONAL
)
set(qml_module_single_args
@@ -103,6 +105,10 @@ function(qt_add_qml_module target)
set(skip_registration_arg SKIP_TYPE_REGISTRATION)
endif()
+ if (arg_PLUGIN_OPTIONAL)
+ set(plugin_optional_arg PLUGIN_OPTIONAL)
+ endif()
+
if (arg_GENERATE_QMLTYPES)
set(generate_qmltypes_arg GENERATE_QMLTYPES)
endif()
@@ -113,6 +119,7 @@ function(qt_add_qml_module target)
${designer_supported_arg}
${no_create_option}
${skip_registration_arg}
+ ${plugin_optional_arg}
${classname_arg}
${generate_qmltypes_arg}
RESOURCE_PREFIX "/qt-project.org/imports"