diff options
author | Craig Scott <craig.scott@qt.io> | 2021-02-15 12:18:28 +1100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-02-25 01:20:02 +0000 |
commit | 2ef9fe42d1d21bb3218945d178c6d69547b27c6d (patch) | |
tree | 433fc75ae9f191fe00ec4f4da08206692c2099f7 /cmake | |
parent | 4bf51e4ca91e6e927f1b539c33dd8f6e7baada82 (diff) |
Avoid cyclic dependency between plugin and module *Config.cmake files
In static per-repo builds, we have a mix of targets provided by
packages and targets provided by the main build. For the builds that
create the packages, we must avoid adding a dependency for the main
module library target on its associated plugin targets or else the
package config files end up with a cyclic dependency that cannot be
resolved when something tries to consume them. This only happens for
static builds because we have been attaching a linking relationship
to the main module library that isn't really a true dependency, we
attached it only for convenience of things linking to that module
library.
To preserve that convenience linking without breaking the config
packages, we use the QT_NO_CREATE_TARGETS condition to prevent CMake
seeing that relationship when generating the *Config.cmake files.
Creating these relationships will be delayed until the plugin's
*Config.cmake file is loaded, at which point it will add itself to
the main module library's imported target INTERFACE (this was already
done before, we just now rely solely on that).
Task-number: QTBUG-90819
Change-Id: Id725742182bcda64841be84fe1650bafb9151bb1
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit be7e20213cc34d6ab23d3db938c6b9317034c9d7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/QtPlugins.cmake.in | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/cmake/QtPlugins.cmake.in b/cmake/QtPlugins.cmake.in index 8e54eea843..6df9541e18 100644 --- a/cmake/QtPlugins.cmake.in +++ b/cmake/QtPlugins.cmake.in @@ -156,6 +156,6 @@ function(__qt_internal_add_static_plugins_once) set_target_properties(${_module_target} PROPERTIES __qt_internal_plugins_added TRUE) endfunction() -if(NOT @BUILD_SHARED_LIBS@) +if(NOT @BUILD_SHARED_LIBS@ AND NOT QT_NO_CREATE_TARGETS) __qt_internal_add_static_plugins_once() endif() |