diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2021-09-03 09:54:46 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-09-03 15:10:44 +0000 |
commit | 4fbed6fa4ea643825bb5707282e8df685e0cc5c9 (patch) | |
tree | 87750a793d755d9268833a34ec7377e874a62582 /src | |
parent | da85503c98f120d3223b5d00860b107226a2736d (diff) |
Allow plugins to be optional if they have no backing target
As we encourage linking to plugins, this is a valid case these days. If
the plugin was already linked, it shouldn't be dynamically loaded
anymore. Conversely, a non-optional plugin should not be linked into
anything, unless it's linked statically.
Change-Id: Id5f0fa0ad745d458ce3235bcc2c0e569760e9db2
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 483274ee3e259ddef19d0a00c004ec33c1a89276)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/qml/Qt6QmlMacros.cmake | 4 | ||||
-rw-r--r-- | src/qml/doc/src/cmake/qt_add_qml_module.qdoc | 4 |
2 files changed, 1 insertions, 7 deletions
diff --git a/src/qml/Qt6QmlMacros.cmake b/src/qml/Qt6QmlMacros.cmake index 9111d77bc4..af9d60b926 100644 --- a/src/qml/Qt6QmlMacros.cmake +++ b/src/qml/Qt6QmlMacros.cmake @@ -231,10 +231,6 @@ function(qt6_add_qml_module target) "specify NO_CREATE_PLUGIN_TARGET." ) endif() - if(arg_PLUGIN_TARGET STREQUAL target) - # The plugin can't be optional when it has no backing target - set(arg_NO_PLUGIN_OPTIONAL TRUE) - endif() if(NOT arg_INSTALLED_PLUGIN_TARGET) set(arg_INSTALLED_PLUGIN_TARGET ${arg_PLUGIN_TARGET}) endif() 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 fc56e745f8..763e04dcb2 100644 --- a/src/qml/doc/src/cmake/qt_add_qml_module.qdoc +++ b/src/qml/doc/src/cmake/qt_add_qml_module.qdoc @@ -368,9 +368,7 @@ arrangement. The auto-generated plugin source file satisfies this requirement. Where a project provides its own \c{.cpp} implementation for the plugin, that would normally mean the \c NO_PLUGIN_OPTIONAL keyword is also needed because the plugin will almost certainly contain functionality that the QML module -requires. If the plugin is its own backing target, meaning \c target and -\c PLUGIN_TARGET are the same, then \c NO_PLUGIN_OPTIONAL is assumed and does -not need to be explicitly provided. +requires. Type registration is automatically performed for the backing target's C++ sources that are processed by AUTOMOC. This will generate a typeinfo file in the |