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>
This commit is contained in:
parent
054c1aaf79
commit
1b4ea4a1d8
@ -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}")
|
||||
|
Loading…
x
Reference in New Issue
Block a user