summaryrefslogtreecommitdiffstats
path: root/cmake/QtPlugins.cmake.in
diff options
context:
space:
mode:
authorCraig Scott <craig.scott@qt.io>2021-03-19 20:04:23 +1100
committerCraig Scott <craig.scott@qt.io>2021-03-23 11:15:33 +1100
commit5807e1ae8168a5702ad0f6890d2b35223cfebdee (patch)
tree83b8815b8d11154c2a9d0a602f750585e3d0afb8 /cmake/QtPlugins.cmake.in
parentdd7920821ec4ac51375084ed625c726cd6dbdb48 (diff)
Add plugins to Qt tools and executables for static builds
In static builds, we cannot allow any part of the main build to make a call to find_package(Qt6...) where such a call may load a Qt6*Plugins.cmake file. That would add additional dependencies to the main module targets, setting up a circular dependency in the set of *Config.cmake files which cannot be resolved. This scenario would be triggered by per-repo builds or user projects. But Qt's tools and other executables still need to load some plugins in static builds. Sometimes a platform plugin may be enough, other times we may want all supportable plugins (e.g. Qt Designer). Therefore, add all plugins we can identify as relevant for an executable that is part of the Qt build, but add them directly to the executable without affecting the linking relationships between the main module libraries. Also remove the now unnecessary check for QT_BUILD_PROJECT_NAME in top level builds because there should be no difference between per-repo and top level builds any more (as far as linking static plugins is concerned). Examples that build as part of the main build will still build successfully after this change, but they will not run if they require a platform plugin. Examples need to be moved out to a separate build where they can call find_package(Qt6) without QT_NO_CREATE_TARGETS set to TRUE to be runnable (see QTBUG-90820). Fixes: QTBUG-91915 Pick-to: 6.1 Change-Id: I8088baddb54e394ca111b103313596d6743570ba Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'cmake/QtPlugins.cmake.in')
-rw-r--r--cmake/QtPlugins.cmake.in13
1 files changed, 0 insertions, 13 deletions
diff --git a/cmake/QtPlugins.cmake.in b/cmake/QtPlugins.cmake.in
index fd3370b9a2..d57611caec 100644
--- a/cmake/QtPlugins.cmake.in
+++ b/cmake/QtPlugins.cmake.in
@@ -35,18 +35,6 @@ function(__qt_internal_add_static_plugins_once)
# Plugin genex marker for prl processing.
set(_is_plugin_marker_genex "$<BOOL:QT_IS_PLUGIN_GENEX>")
- # In super builds the rules below pollute the dependency rule for the
- # plugin target when it's being build, causing cyclic dependencies.
- # to overcome this, we check if the current target where this rule evaluates
- # has a QT_BUILD_PROJECT_NAME equal to the current PROJECT_NAME.
- # If so we disable the injection of plugin link rules to avoid cyclic
- # dependencies.
- if (@QT_SUPERBUILD@)
- set(_build_allow_plugin_link_rules_genex "$<NOT:$<STREQUAL:$<TARGET_PROPERTY:QT_BUILD_PROJECT_NAME>,@PROJECT_NAME@>>")
- else()
- set(_build_allow_plugin_link_rules_genex 1)
- endif()
-
# The code in here uses the properties defined in qt_import_plugins (Qt6CoreMacros.cmake)
foreach(target ${_qt_plugins})
set(_plugin_target "@INSTALL_CMAKE_NAMESPACE@::${target}")
@@ -115,7 +103,6 @@ function(__qt_internal_add_static_plugins_once)
string(CONCAT _plugin_condition
"$<BOOL:$<AND:"
"${_is_plugin_marker_genex},"
- "${_build_allow_plugin_link_rules_genex},"
"$<OR:"
"${_plugin_is_whitelisted},"
"${_plugin_versionless_is_whitelisted},"