diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2020-10-26 11:24:27 +0100 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2020-10-26 13:46:49 +0100 |
commit | 1b4ea4a1d826244c2711e1a5238da6440ec1b1c3 (patch) | |
tree | d5c39600e6bb0d6072f09151612112797dda1e51 /cmake | |
parent | 054c1aaf79e1059361ec6f299b2a90e77dd08b12 (diff) |
CMake: Fix target dependency cycle regarding qpa plugins in qtwayland
With the introduction of the new 'default_qpa_plugins' custom target,
a target dependency cycle occurred in qtwayland:
qtwaylandscanner -> default_qpa_plugins -> a wayland qpa plugin ->
WaylandClient -> qtwaylandscanner
The issue is twofold:
- default_qpa_plugins accidentally depended on non-qpa plugins.
- All qpa plugins were enabled by default, including the wayland ones.
Fix the default_qpa_plugins target not to depend on regular non-qpa
plugins.
Also fix qpa plugins not to be enabled by default, but instead only
choose one qpa plugin to be the default (via evaluating the
DEFAULT_IF) condition.
Amends df9c7456d11dfcf74c7399ba0981a3ba3d3f5117
Change-Id: I22cd2c72f6b75be54263fd21097258bd179e3616
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/QtPluginHelpers.cmake | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/cmake/QtPluginHelpers.cmake b/cmake/QtPluginHelpers.cmake index 6b362b5017..07952bde48 100644 --- a/cmake/QtPluginHelpers.cmake +++ b/cmake/QtPluginHelpers.cmake @@ -133,19 +133,31 @@ function(qt_internal_add_plugin target) _qt_plugin_install_package_suffix "${plugin_install_package_suffix}") endif() - set(_default_plugin 1) + # TODO: This is a bit too coarse for generic plugins. + # The generic plugins should also be enabled by default, once QTBUG-87861 is fixed. + # But platform plugins should always be disabled by default, and only one is enabled + # based on the platform (condition specified in arg_DEFAULT_IF). + if(plugin_type_escaped STREQUAL "generic" OR plugin_type_escaped STREQUAL "platforms") + set(_default_plugin 0) + else() + set(_default_plugin 1) + endif() + if (DEFINED arg_DEFAULT_IF) if (NOT ${arg_DEFAULT_IF}) set(_default_plugin 0) + else() + set(_default_plugin 1) endif() endif() add_dependencies(qt_plugins "${target}") if(arg_TYPE STREQUAL "platforms") add_dependencies(qpa_plugins "${target}") - endif() - if(_default_plugin) - add_dependencies(qpa_default_plugins "${target}") + + if(_default_plugin) + add_dependencies(qpa_default_plugins "${target}") + endif() endif() set_property(TARGET "${target}" PROPERTY QT_DEFAULT_PLUGIN "${_default_plugin}") |