diff options
author | Craig Scott <craig.scott@qt.io> | 2021-02-10 12:11:39 +1100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-02-24 08:32:35 +0000 |
commit | bd70f6d5503ead56012a9703b110b2080fd266e4 (patch) | |
tree | b428f53f4b522e234a65866bf967904a97a21550 /src/plugins/styles | |
parent | 933e4c328e580d265dae5d1a73f7c44c61eef40d (diff) |
cmake: Don't give plugins PUBLIC usage requirements
The pro2cmake.py conversion script faithfully reproduced the .pro files
for the plugins, which specified the libraries as public. But in CMake,
the implications of this are that public usage requirements should then
be propagated to consumers. We don't expect any consumers, since a
plugin is created as a MODULE library in CMake, so for Windows we don't
even have an import library to link with. The only exception to this is
for static builds where plugins are created as STATIC libraries
instead, but only in certain controlled situations do we then link to
plugins. Even then, usage requirements are not expected to propagate to
the consumers, so these relationships should always be specified as
private.
This change warns on any PUBLIC usage requirements specified for a
plugin. This check is disabled by default to avoid spamming CI builds
for repos that haven't been fixed yet. The check can be enabled by a
CMake cache option, which is intended for developers to use locally
when fixing this issue in other repos (all plugins in qtbase should
not trigger this warning as a result of changes in this commit).
Task-number: QTBUG-90819
Change-Id: I09f2c8da77db1193ad3370f85d367dfc6ab7b9a6
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit fe29159aad0e03ca5eebabf910c90f279b222d03)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/plugins/styles')
-rw-r--r-- | src/plugins/styles/android/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/plugins/styles/mac/CMakeLists.txt | 1 | ||||
-rw-r--r-- | src/plugins/styles/windowsvista/CMakeLists.txt | 1 |
3 files changed, 1 insertions, 3 deletions
diff --git a/src/plugins/styles/android/CMakeLists.txt b/src/plugins/styles/android/CMakeLists.txt index a556f7bd40..312f8ecfff 100644 --- a/src/plugins/styles/android/CMakeLists.txt +++ b/src/plugins/styles/android/CMakeLists.txt @@ -10,7 +10,7 @@ qt_internal_add_plugin(QAndroidStylePlugin SOURCES main.cpp qandroidstyle.cpp qandroidstyle_p.h - PUBLIC_LIBRARIES + LIBRARIES Qt::Core Qt::Gui Qt::WidgetsPrivate diff --git a/src/plugins/styles/mac/CMakeLists.txt b/src/plugins/styles/mac/CMakeLists.txt index ea0c7aee04..f95579b474 100644 --- a/src/plugins/styles/mac/CMakeLists.txt +++ b/src/plugins/styles/mac/CMakeLists.txt @@ -13,7 +13,6 @@ qt_internal_add_plugin(QMacStylePlugin qmacstyle_mac_p_p.h LIBRARIES ${FWAppKit} - PUBLIC_LIBRARIES Qt::Core Qt::Gui Qt::WidgetsPrivate diff --git a/src/plugins/styles/windowsvista/CMakeLists.txt b/src/plugins/styles/windowsvista/CMakeLists.txt index 224b7f1da1..f668b21632 100644 --- a/src/plugins/styles/windowsvista/CMakeLists.txt +++ b/src/plugins/styles/windowsvista/CMakeLists.txt @@ -17,7 +17,6 @@ qt_internal_add_plugin(QWindowsVistaStylePlugin gdi32 user32 uxtheme - PUBLIC_LIBRARIES Qt::Core Qt::Gui Qt::WidgetsPrivate |