From 5dc14c88f9510795835fb4f0a0d46d67c40f7020 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Tue, 2 Jun 2020 16:50:20 +0200 Subject: 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 Reviewed-by: Fabian Kosmale --- src/qml/Qt6QmlBuildInternals.cmake | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/qml/Qt6QmlBuildInternals.cmake') 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" -- cgit v1.2.3