Bundle QPA plugin directly

On wayland, we know we're always going to load our internal QPA. Instead
of shipping a plugin and loading it dynamically we can use Qt static
plugins.

This should result in slightly faster load times, but also reduce the
number of moving pieces for kwin.

This also prevents anyone outside kwin loading our QPA which wouldn't
have made any sense and just crashed.
This commit is contained in:
David Edmundson 2020-11-20 14:28:47 +00:00
parent 786207a4ba
commit 5e60e64a5d
5 changed files with 8 additions and 10 deletions

View file

@ -826,6 +826,7 @@ endif()
add_subdirectory(platformsupport)
add_subdirectory(plugins)
target_link_libraries(kwin_wayland KWinQpaPlugin)
########### install files ###############

View file

@ -26,7 +26,7 @@ ecm_add_qtwayland_client_protocol(KWinIntegrationTestFramework_SOURCES
BASENAME xdg-shell
)
add_library(KWinIntegrationTestFramework STATIC ${KWinIntegrationTestFramework_SOURCES})
target_link_libraries(KWinIntegrationTestFramework kwin Qt5::Test Wayland::Client)
target_link_libraries(KWinIntegrationTestFramework kwin Qt5::Test Wayland::Client KWinQpaPlugin)
function(integrationTest)
set(optionArgs WAYLAND_ONLY)

View file

@ -30,6 +30,8 @@
#include <sys/socket.h>
#include <iostream>
Q_IMPORT_PLUGIN(KWinIntegrationPlugin)
namespace KWin
{

View file

@ -60,6 +60,8 @@
#include <iostream>
#include <iomanip>
Q_IMPORT_PLUGIN(KWinIntegrationPlugin)
namespace KWin
{

View file

@ -16,8 +16,8 @@ set(QPA_SOURCES
include(ECMQtDeclareLoggingCategory)
ecm_qt_declare_logging_category(QPA_SOURCES HEADER logging.h IDENTIFIER KWIN_QPA CATEGORY_NAME kwin_qpa_plugin DEFAULT_SEVERITY Critical)
add_library(KWinQpaPlugin MODULE ${QPA_SOURCES})
set_target_properties(KWinQpaPlugin PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/platforms/")
add_library(KWinQpaPlugin OBJECT ${QPA_SOURCES})
target_compile_definitions(KWinQpaPlugin PRIVATE QT_STATICPLUGIN)
set(QT5PLATFORMSUPPORT_LIBS
Qt5::FontDatabaseSupportPrivate
@ -31,10 +31,3 @@ target_link_libraries(KWinQpaPlugin
Fontconfig::Fontconfig
kwin
)
install(
TARGETS
KWinQpaPlugin
DESTINATION
${PLUGIN_INSTALL_DIR}/platforms/
)