diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2021-04-20 17:23:47 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-04-21 18:30:11 +0000 |
commit | 5f34b848d0f28fb048bd947882ab0a7bd647e3df (patch) | |
tree | c5c9d037b15280779a519f266bd09cc84ee2758e /cmake | |
parent | 51c6e25d09dbb6fc94ec3e5f6306678803cb11bf (diff) |
CMake: Fix auto-linking of static plugins in standalone tests
The change introduced in 98e8180e56322ce065e39cc1ef1d65b54caa8c25
fixes reconfiguration issues for repositories that provide plugins
associated with modules from a different repository
(QSvgPlugin -> QtGui -> qtbase).
It does so by only loading the public Plugin CMake packages of
dependent repositories.
For executables / tests that are built as part of the current
repository, plugins are linked via a different simplified mechanism in
qt_add_internal_plugin and qt_internal_add_plugin in order to prevent
exporting link cycles between plugins and Qt modules.
This works for the majority of in-tree tests, but unfortunately breaks
static standalone tests.
For example in qtbase neither mechanism will link plugins to the
standalone tests:
- qtbase has no repo dependencies, so the first mechanism (loading of
public plugin packages) is skipped because we assume we are merely
reconfiguring the main build of qtbase and we don't want to
accidentally create duplicate plugin targets
- because a standalone test configuration does not call
qt_internal_add_plugin, no association is done between qt plugin
and module and thus all tests (qt_internal_add_test ->
qt_internal_add_executable) don't get the simplified plugin
linking
Fix this by allowing loading of the public CMake plugin packages when
doing standalone tests. It should be safe to do so because we don't
build any plugins in this case, only tests.
Amends 98e8180e56322ce065e39cc1ef1d65b54caa8c25
Task-number: QTBUG-87580
Change-Id: I690a0366c73a24e7f49c65ed13cd70362c273d81
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit be1ee03a0fafa28efa0c0e45f21f9dc684625957)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/QtPluginConfig.cmake.in | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/cmake/QtPluginConfig.cmake.in b/cmake/QtPluginConfig.cmake.in index e3fe9f06ae..7bd9a1d579 100644 --- a/cmake/QtPluginConfig.cmake.in +++ b/cmake/QtPluginConfig.cmake.in @@ -1,6 +1,6 @@ include_guard(DIRECTORY) -if(DEFINED QT_REPO_DEPENDENCIES) +if(DEFINED QT_REPO_DEPENDENCIES AND NOT QT_BUILD_STANDALONE_TESTS) # We're building a Qt repository. # Skip this plugin if it has not been provided by one of this repo's dependencies. string(TOLOWER "@PROJECT_NAME@" lower_case_project_name) |