diff options
author | Craig Scott <craig.scott@qt.io> | 2021-03-19 20:04:23 +1100 |
---|---|---|
committer | Craig Scott <craig.scott@qt.io> | 2021-03-23 11:15:33 +1100 |
commit | 5807e1ae8168a5702ad0f6890d2b35223cfebdee (patch) | |
tree | 83b8815b8d11154c2a9d0a602f750585e3d0afb8 /cmake/QtModuleHelpers.cmake | |
parent | dd7920821ec4ac51375084ed625c726cd6dbdb48 (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/QtModuleHelpers.cmake')
-rw-r--r-- | cmake/QtModuleHelpers.cmake | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/cmake/QtModuleHelpers.cmake b/cmake/QtModuleHelpers.cmake index 6268bfe960..efd9cd9a8e 100644 --- a/cmake/QtModuleHelpers.cmake +++ b/cmake/QtModuleHelpers.cmake @@ -241,15 +241,6 @@ function(qt_internal_add_module target) endif() if(NOT arg_HEADER_MODULE) - # This property is used for super builds with static libraries. We use - # it in QtPlugins.cmake.in to avoid "polluting" the dependency chain - # for the target in it's project directory. - # E.g: When we process find_package(Qt6 ... Gui) in QtDeclarative, the - # rules in QtPugins.cmake add all the known Gui plugins as interface - # dependencies. This in turn causes circular dependencies on every - # plugin which links against Gui. Plugin A -> GUI -> Plugin A .... - - set_target_properties(${target} PROPERTIES QT_BUILD_PROJECT_NAME ${PROJECT_NAME}) # Plugin types associated to a module if(NOT "x${arg_PLUGIN_TYPES}" STREQUAL "x") # Reset the variable containing the list of plugins for the given plugin type |