summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms
diff options
context:
space:
mode:
authorCraig Scott <craig.scott@qt.io>2021-02-10 12:11:39 +1100
committerCraig Scott <craig.scott@qt.io>2021-02-24 10:37:49 +1100
commitfe29159aad0e03ca5eebabf910c90f279b222d03 (patch)
tree3112b7e303f2ff2ee2ad6fed834cb0fbdb708815 /src/plugins/platforms
parent1f30bcf33618ca39c47dc1058529b55635e30aef (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 Pick-to: 6.1 Change-Id: I09f2c8da77db1193ad3370f85d367dfc6ab7b9a6 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'src/plugins/platforms')
-rw-r--r--src/plugins/platforms/android/CMakeLists.txt2
-rw-r--r--src/plugins/platforms/cocoa/CMakeLists.txt2
-rw-r--r--src/plugins/platforms/direct2d/CMakeLists.txt23
-rw-r--r--src/plugins/platforms/directfb/CMakeLists.txt2
-rw-r--r--src/plugins/platforms/eglfs/CMakeLists.txt2
-rw-r--r--src/plugins/platforms/ios/CMakeLists.txt6
-rw-r--r--src/plugins/platforms/ios/optional/nsphotolibrarysupport/CMakeLists.txt2
-rw-r--r--src/plugins/platforms/linuxfb/CMakeLists.txt6
-rw-r--r--src/plugins/platforms/minimal/CMakeLists.txt2
-rw-r--r--src/plugins/platforms/minimalegl/CMakeLists.txt4
-rw-r--r--src/plugins/platforms/offscreen/CMakeLists.txt2
-rw-r--r--src/plugins/platforms/vnc/CMakeLists.txt4
-rw-r--r--src/plugins/platforms/windows/CMakeLists.txt21
-rw-r--r--src/plugins/platforms/xcb/CMakeLists.txt2
-rw-r--r--src/plugins/platforms/xcb/gl_integrations/xcb_egl/CMakeLists.txt2
-rw-r--r--src/plugins/platforms/xcb/gl_integrations/xcb_glx/CMakeLists.txt6
16 files changed, 43 insertions, 45 deletions
diff --git a/src/plugins/platforms/android/CMakeLists.txt b/src/plugins/platforms/android/CMakeLists.txt
index 2e323325b0..af9b7429b6 100644
--- a/src/plugins/platforms/android/CMakeLists.txt
+++ b/src/plugins/platforms/android/CMakeLists.txt
@@ -46,7 +46,7 @@ qt_internal_add_plugin(QAndroidIntegrationPlugin
INCLUDE_DIRECTORIES
${CMAKE_CURRENT_SOURCE_DIR}
${QT_SOURCE_TREE}/src/3rdparty/android
- PUBLIC_LIBRARIES
+ LIBRARIES
EGL::EGL
Qt::Core
Qt::CorePrivate
diff --git a/src/plugins/platforms/cocoa/CMakeLists.txt b/src/plugins/platforms/cocoa/CMakeLists.txt
index 8dbf534c9b..62eaad8e02 100644
--- a/src/plugins/platforms/cocoa/CMakeLists.txt
+++ b/src/plugins/platforms/cocoa/CMakeLists.txt
@@ -50,7 +50,7 @@ qt_internal_add_plugin(QCocoaIntegrationPlugin
qcocoafontdialoghelper.h qcocoafontdialoghelper.mm
DEFINES
QT_NO_FOREACH
- PUBLIC_LIBRARIES
+ LIBRARIES
${FWAppKit}
${FWCarbon}
${FWCoreServices}
diff --git a/src/plugins/platforms/direct2d/CMakeLists.txt b/src/plugins/platforms/direct2d/CMakeLists.txt
index 3d507af070..94c435ea69 100644
--- a/src/plugins/platforms/direct2d/CMakeLists.txt
+++ b/src/plugins/platforms/direct2d/CMakeLists.txt
@@ -50,27 +50,26 @@ qt_internal_add_plugin(QWindowsDirect2DIntegrationPlugin
INCLUDE_DIRECTORIES
../windows
LIBRARIES
- advapi32
- d2d1 # special case
- dwrite # special case
- gdi32
- ole32
- shell32
- user32
- winmm
- PUBLIC_LIBRARIES
Qt::Core
Qt::CorePrivate
Qt::Gui
Qt::GuiPrivate
+ advapi32
+ d2d1 # special case
d3d11
dwmapi
+ dwrite # special case
dxgi
dxguid
+ gdi32
imm32
+ ole32
oleaut32
+ shell32
shlwapi
+ user32
version
+ winmm
winspool
wtsapi32
)
@@ -102,12 +101,12 @@ qt_internal_add_resource(QWindowsDirect2DIntegrationPlugin "openglblacklists"
# PLUGIN_EXTENDS = "-"
qt_internal_extend_target(QWindowsDirect2DIntegrationPlugin CONDITION QT_FEATURE_opengl AND NOT QT_FEATURE_dynamicgl
- PUBLIC_LIBRARIES
+ LIBRARIES
opengl32
)
qt_internal_extend_target(QWindowsDirect2DIntegrationPlugin CONDITION MINGW
- PUBLIC_LIBRARIES
+ LIBRARIES
uuid
)
@@ -272,7 +271,7 @@ qt_internal_extend_target(QWindowsDirect2DIntegrationPlugin CONDITION QT_FEATURE
)
qt_internal_extend_target(QWindowsDirect2DIntegrationPlugin CONDITION MINGW AND QT_FEATURE_accessibility
- PUBLIC_LIBRARIES
+ LIBRARIES
uuid
)
diff --git a/src/plugins/platforms/directfb/CMakeLists.txt b/src/plugins/platforms/directfb/CMakeLists.txt
index c66d8bd169..e54c6a0b79 100644
--- a/src/plugins/platforms/directfb/CMakeLists.txt
+++ b/src/plugins/platforms/directfb/CMakeLists.txt
@@ -23,7 +23,7 @@ qt_internal_add_plugin(QDirectFbIntegrationPlugin
qdirectfbintegration.cpp qdirectfbintegration.h
qdirectfbscreen.cpp qdirectfbscreen.h
qdirectfbwindow.cpp qdirectfbwindow.h
- PUBLIC_LIBRARIES
+ LIBRARIES
PkgConfig::DirectFB
EGL::EGL # special case
Qt::Core
diff --git a/src/plugins/platforms/eglfs/CMakeLists.txt b/src/plugins/platforms/eglfs/CMakeLists.txt
index 25223d5d3b..0e0d0ed06e 100644
--- a/src/plugins/platforms/eglfs/CMakeLists.txt
+++ b/src/plugins/platforms/eglfs/CMakeLists.txt
@@ -102,7 +102,7 @@ qt_internal_add_plugin(QEglFSIntegrationPlugin
qeglfsmain.cpp
DEFINES
QT_EGL_NO_X11
- PUBLIC_LIBRARIES
+ LIBRARIES
Qt::CorePrivate # special case
Qt::EglFSDeviceIntegrationPrivate
EGL::EGL # special case
diff --git a/src/plugins/platforms/ios/CMakeLists.txt b/src/plugins/platforms/ios/CMakeLists.txt
index aef8c6f522..cebecadc3c 100644
--- a/src/plugins/platforms/ios/CMakeLists.txt
+++ b/src/plugins/platforms/ios/CMakeLists.txt
@@ -27,7 +27,7 @@ qt_internal_add_plugin(QIOSIntegrationPlugin
qioswindow.h qioswindow.mm
quiaccessibilityelement.h quiaccessibilityelement.mm
quiview.h quiview.mm
- PUBLIC_LIBRARIES
+ LIBRARIES
${FWAudioToolbox}
${FWFoundation}
${FWMetal}
@@ -47,7 +47,7 @@ qt_disable_apple_app_extension_api_only(QIOSIntegrationPlugin)
#####################################################################
qt_internal_extend_target(QIOSIntegrationPlugin CONDITION QT_FEATURE_opengl
- PUBLIC_LIBRARIES
+ LIBRARIES
Qt::OpenGLPrivate
)
@@ -59,7 +59,7 @@ qt_internal_extend_target(QIOSIntegrationPlugin CONDITION NOT TVOS
qiosmenu.h qiosmenu.mm
qiosmessagedialog.h qiosmessagedialog.mm
qiostextinputoverlay.h qiostextinputoverlay.mm
- PUBLIC_LIBRARIES
+ LIBRARIES
${FWAssetsLibrary}
)
diff --git a/src/plugins/platforms/ios/optional/nsphotolibrarysupport/CMakeLists.txt b/src/plugins/platforms/ios/optional/nsphotolibrarysupport/CMakeLists.txt
index 82e5691d10..76253adb47 100644
--- a/src/plugins/platforms/ios/optional/nsphotolibrarysupport/CMakeLists.txt
+++ b/src/plugins/platforms/ios/optional/nsphotolibrarysupport/CMakeLists.txt
@@ -13,7 +13,7 @@ qt_internal_add_plugin(QIosOptionalPlugin_NSPhotoLibrary
qiosfileengineassetslibrary.h qiosfileengineassetslibrary.mm
qiosfileenginefactory.h
qiosimagepickercontroller.h qiosimagepickercontroller.mm
- PUBLIC_LIBRARIES
+ LIBRARIES
${FWAssetsLibrary}
${FWFoundation}
${FWUIKit}
diff --git a/src/plugins/platforms/linuxfb/CMakeLists.txt b/src/plugins/platforms/linuxfb/CMakeLists.txt
index d903fdc6a7..1a241463a7 100644
--- a/src/plugins/platforms/linuxfb/CMakeLists.txt
+++ b/src/plugins/platforms/linuxfb/CMakeLists.txt
@@ -14,7 +14,7 @@ qt_internal_add_plugin(QLinuxFbIntegrationPlugin
qlinuxfbscreen.cpp qlinuxfbscreen.h
DEFINES
QT_NO_FOREACH
- PUBLIC_LIBRARIES
+ LIBRARIES
Qt::Core
Qt::CorePrivate
Qt::FbSupportPrivate
@@ -29,14 +29,14 @@ qt_internal_add_plugin(QLinuxFbIntegrationPlugin
#####################################################################
qt_internal_extend_target(QLinuxFbIntegrationPlugin CONDITION TARGET Qt::InputSupportPrivate
- PUBLIC_LIBRARIES
+ LIBRARIES
Qt::InputSupportPrivate
)
qt_internal_extend_target(QLinuxFbIntegrationPlugin CONDITION TARGET Qt::KmsSupportPrivate
SOURCES
qlinuxfbdrmscreen.cpp qlinuxfbdrmscreen.h
- PUBLIC_LIBRARIES
+ LIBRARIES
Qt::KmsSupportPrivate
)
diff --git a/src/plugins/platforms/minimal/CMakeLists.txt b/src/plugins/platforms/minimal/CMakeLists.txt
index 3f6945ed26..3abecdcb4a 100644
--- a/src/plugins/platforms/minimal/CMakeLists.txt
+++ b/src/plugins/platforms/minimal/CMakeLists.txt
@@ -16,7 +16,7 @@ qt_internal_add_plugin(QMinimalIntegrationPlugin
qminimalintegration.cpp qminimalintegration.h
DEFINES
QT_NO_FOREACH
- PUBLIC_LIBRARIES
+ LIBRARIES
Qt::Core
Qt::CorePrivate
Qt::Gui
diff --git a/src/plugins/platforms/minimalegl/CMakeLists.txt b/src/plugins/platforms/minimalegl/CMakeLists.txt
index 1758eb3af0..5a5b57f963 100644
--- a/src/plugins/platforms/minimalegl/CMakeLists.txt
+++ b/src/plugins/platforms/minimalegl/CMakeLists.txt
@@ -16,7 +16,7 @@ qt_internal_add_plugin(QMinimalEglIntegrationPlugin
qminimaleglwindow.cpp qminimaleglwindow.h
DEFINES
QT_EGL_NO_X11
- PUBLIC_LIBRARIES
+ LIBRARIES
Qt::Core
Qt::CorePrivate
Qt::Gui
@@ -33,7 +33,7 @@ qt_internal_add_plugin(QMinimalEglIntegrationPlugin
qt_internal_extend_target(QMinimalEglIntegrationPlugin CONDITION QT_FEATURE_opengl
SOURCES
qminimaleglbackingstore.cpp qminimaleglbackingstore.h
- PUBLIC_LIBRARIES
+ LIBRARIES
Qt::OpenGL
)
diff --git a/src/plugins/platforms/offscreen/CMakeLists.txt b/src/plugins/platforms/offscreen/CMakeLists.txt
index 160aa7df93..bb73ce38aa 100644
--- a/src/plugins/platforms/offscreen/CMakeLists.txt
+++ b/src/plugins/platforms/offscreen/CMakeLists.txt
@@ -15,7 +15,7 @@ qt_internal_add_plugin(QOffscreenIntegrationPlugin
qoffscreenwindow.cpp qoffscreenwindow.h
DEFINES
QT_NO_FOREACH
- PUBLIC_LIBRARIES
+ LIBRARIES
Qt::Core
Qt::CorePrivate
Qt::Gui
diff --git a/src/plugins/platforms/vnc/CMakeLists.txt b/src/plugins/platforms/vnc/CMakeLists.txt
index f3782b5434..7c28e26d9b 100644
--- a/src/plugins/platforms/vnc/CMakeLists.txt
+++ b/src/plugins/platforms/vnc/CMakeLists.txt
@@ -16,7 +16,7 @@ qt_internal_add_plugin(QVncIntegrationPlugin
qvncscreen.cpp qvncscreen.h
DEFINES
QT_NO_FOREACH
- PUBLIC_LIBRARIES
+ LIBRARIES
Qt::Core
Qt::CorePrivate
Qt::FbSupportPrivate
@@ -32,7 +32,7 @@ qt_internal_add_plugin(QVncIntegrationPlugin
#####################################################################
qt_internal_extend_target(QVncIntegrationPlugin CONDITION TARGET Qt::InputSupportPrivate
- PUBLIC_LIBRARIES
+ LIBRARIES
Qt::InputSupportPrivate
)
diff --git a/src/plugins/platforms/windows/CMakeLists.txt b/src/plugins/platforms/windows/CMakeLists.txt
index 77d2f2a714..43f08a6a86 100644
--- a/src/plugins/platforms/windows/CMakeLists.txt
+++ b/src/plugins/platforms/windows/CMakeLists.txt
@@ -43,21 +43,20 @@ qt_internal_add_plugin(QWindowsIntegrationPlugin
INCLUDE_DIRECTORIES
${CMAKE_CURRENT_SOURCE_DIR}
LIBRARIES
- advapi32
- gdi32
- ole32
- shell32
- user32
- winmm
- PUBLIC_LIBRARIES
Qt::Core
Qt::CorePrivate
Qt::Gui
Qt::GuiPrivate
+ advapi32
dwmapi
+ gdi32
imm32
+ ole32
oleaut32
+ shell32
shlwapi
+ user32
+ winmm
winspool
wtsapi32
)
@@ -88,7 +87,7 @@ qt_internal_extend_target(QWindowsIntegrationPlugin CONDITION QT_FEATURE_opengl
SOURCES
qwindowsglcontext.cpp qwindowsglcontext.h
qwindowsopenglcontext.h
- PUBLIC_LIBRARIES
+ LIBRARIES
Qt::OpenGLPrivate
)
@@ -96,12 +95,12 @@ qt_internal_extend_target(QWindowsIntegrationPlugin CONDITION QT_FEATURE_opengl
# PLUGIN_EXTENDS = "-"
qt_internal_extend_target(QWindowsIntegrationPlugin CONDITION QT_FEATURE_opengl AND NOT QT_FEATURE_dynamicgl
- PUBLIC_LIBRARIES
+ LIBRARIES
opengl32
)
qt_internal_extend_target(QWindowsIntegrationPlugin CONDITION MINGW
- PUBLIC_LIBRARIES
+ LIBRARIES
uuid
)
@@ -195,7 +194,7 @@ qt_internal_extend_target(QWindowsIntegrationPlugin CONDITION QT_FEATURE_accessi
)
qt_internal_extend_target(QWindowsIntegrationPlugin CONDITION MINGW AND QT_FEATURE_accessibility
- PUBLIC_LIBRARIES
+ LIBRARIES
uuid
)
diff --git a/src/plugins/platforms/xcb/CMakeLists.txt b/src/plugins/platforms/xcb/CMakeLists.txt
index ab19501991..806b76bb72 100644
--- a/src/plugins/platforms/xcb/CMakeLists.txt
+++ b/src/plugins/platforms/xcb/CMakeLists.txt
@@ -168,7 +168,7 @@ qt_internal_add_plugin(QXcbIntegrationPlugin
qxcbmain.cpp
DEFINES
QT_NO_FOREACH
- PUBLIC_LIBRARIES
+ LIBRARIES
Qt::CorePrivate
Qt::GuiPrivate
Qt::XcbQpaPrivate
diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_egl/CMakeLists.txt b/src/plugins/platforms/xcb/gl_integrations/xcb_egl/CMakeLists.txt
index a1cecaf719..d24050edf3 100644
--- a/src/plugins/platforms/xcb/gl_integrations/xcb_egl/CMakeLists.txt
+++ b/src/plugins/platforms/xcb/gl_integrations/xcb_egl/CMakeLists.txt
@@ -20,7 +20,7 @@ qt_internal_add_plugin(QXcbEglIntegrationPlugin
INCLUDE_DIRECTORIES
..
../..
- PUBLIC_LIBRARIES
+ LIBRARIES
Qt::Core
Qt::CorePrivate
Qt::Gui
diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/CMakeLists.txt b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/CMakeLists.txt
index 9ebc98ea53..80f785a2f0 100644
--- a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/CMakeLists.txt
+++ b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/CMakeLists.txt
@@ -18,7 +18,7 @@ qt_internal_add_plugin(QXcbGlxIntegrationPlugin
INCLUDE_DIRECTORIES
..
../..
- PUBLIC_LIBRARIES
+ LIBRARIES
Qt::Core
Qt::CorePrivate
Qt::Gui
@@ -30,12 +30,12 @@ qt_internal_add_plugin(QXcbGlxIntegrationPlugin
#####################################################################
qt_internal_extend_target(QXcbGlxIntegrationPlugin CONDITION QT_FEATURE_xcb_glx
- PUBLIC_LIBRARIES
+ LIBRARIES
XCB::GLX
)
qt_internal_extend_target(QXcbGlxIntegrationPlugin
CONDITION QT_FEATURE_dlopen AND QT_BUILD_SHARED_LIBS
- PUBLIC_LIBRARIES
+ LIBRARIES
${CMAKE_DL_LIBS}
)