diff --git a/src/effects/CMakeLists.txt b/src/effects/CMakeLists.txt index c33aacaebe..e88fb78105 100644 --- a/src/effects/CMakeLists.txt +++ b/src/effects/CMakeLists.txt @@ -32,6 +32,7 @@ endfunction() macro(KWIN4_ADD_EFFECT_MODULE name) kcoreaddons_add_plugin(${name} STATIC SOURCES ${ARGN} INSTALL_NAMESPACE "kwin/effects/plugins") + set_property(TARGET ${name} PROPERTY POSITION_INDEPENDENT_CODE ON) kwin_strip_builtin_effect_metadata(${name} metadata.json) install(FILES metadata.json DESTINATION ${KDE_INSTALL_DATADIR}/${KWIN_NAME}/builtin-effects/${name}/) endmacro() diff --git a/src/plugins/idletime/CMakeLists.txt b/src/plugins/idletime/CMakeLists.txt index da7293867b..c0453940cd 100644 --- a/src/plugins/idletime/CMakeLists.txt +++ b/src/plugins/idletime/CMakeLists.txt @@ -3,6 +3,7 @@ set(idletime_plugin_SRCS ) add_library(KF5IdleTimeKWinPlugin OBJECT ${idletime_plugin_SRCS}) +set_property(TARGET KF5IdleTimeKWinPlugin PROPERTY POSITION_INDEPENDENT_CODE ON) target_compile_definitions(KF5IdleTimeKWinPlugin PRIVATE QT_STATICPLUGIN) target_link_libraries(KF5IdleTimeKWinPlugin KF5::IdleTime diff --git a/src/plugins/kglobalaccel/CMakeLists.txt b/src/plugins/kglobalaccel/CMakeLists.txt index 230aa7d602..da62c939fd 100644 --- a/src/plugins/kglobalaccel/CMakeLists.txt +++ b/src/plugins/kglobalaccel/CMakeLists.txt @@ -3,5 +3,6 @@ set(kglobalaccel_plugin_SRCS ) add_library(KF5GlobalAccelKWinPlugin OBJECT ${kglobalaccel_plugin_SRCS}) +set_property(TARGET KF5GlobalAccelKWinPlugin PROPERTY POSITION_INDEPENDENT_CODE ON) target_compile_definitions(KF5GlobalAccelKWinPlugin PRIVATE QT_STATICPLUGIN) target_link_libraries(KF5GlobalAccelKWinPlugin KF5::GlobalAccelPrivate kwin) diff --git a/src/plugins/qpa/CMakeLists.txt b/src/plugins/qpa/CMakeLists.txt index b31dafbc74..91fa22028d 100644 --- a/src/plugins/qpa/CMakeLists.txt +++ b/src/plugins/qpa/CMakeLists.txt @@ -1,4 +1,5 @@ add_library(KWinQpaPlugin OBJECT) +set_property(TARGET KWinQpaPlugin PROPERTY POSITION_INDEPENDENT_CODE ON) target_sources(KWinQpaPlugin PRIVATE backingstore.cpp eglhelpers.cpp diff --git a/src/plugins/windowsystem/CMakeLists.txt b/src/plugins/windowsystem/CMakeLists.txt index c3c59086e7..ac2c296eb7 100644 --- a/src/plugins/windowsystem/CMakeLists.txt +++ b/src/plugins/windowsystem/CMakeLists.txt @@ -6,5 +6,6 @@ set(kwindowsystem_plugin_SRCS ) add_library(KF5WindowSystemKWinPlugin OBJECT ${kwindowsystem_plugin_SRCS}) +set_property(TARGET KF5WindowSystemKWinPlugin PROPERTY POSITION_INDEPENDENT_CODE ON) target_compile_definitions(KF5WindowSystemKWinPlugin PRIVATE QT_STATICPLUGIN) target_link_libraries(KF5WindowSystemKWinPlugin kwin) diff --git a/src/wayland/CMakeLists.txt b/src/wayland/CMakeLists.txt index 08a8b7746b..2c8e618bb5 100644 --- a/src/wayland/CMakeLists.txt +++ b/src/wayland/CMakeLists.txt @@ -8,6 +8,7 @@ endif() # CMake has a known bug where target_source() doesn't work as expected with files generated # in a directory other than the one where the target is defined. It should be fixed in 3.20. add_library(WaylandProtocols_xml OBJECT) +set_property(TARGET WaylandProtocols_xml PROPERTY POSITION_INDEPENDENT_CODE ON) target_link_libraries(WaylandProtocols_xml Qt::Core Wayland::Server) target_link_libraries(kwin WaylandProtocols_xml) diff --git a/src/xwayland/CMakeLists.txt b/src/xwayland/CMakeLists.txt index 62c8c54984..ea001edd1b 100644 --- a/src/xwayland/CMakeLists.txt +++ b/src/xwayland/CMakeLists.txt @@ -16,4 +16,5 @@ add_library(KWinXwaylandServerModule OBJECT xwldrophandler.cpp xwaylandlauncher.cpp ) +set_property(TARGET KWinXwaylandServerModule PROPERTY POSITION_INDEPENDENT_CODE ON) target_link_libraries(KWinXwaylandServerModule PUBLIC kwin KWinXwaylandCommon) diff --git a/src/xwayland/lib/CMakeLists.txt b/src/xwayland/lib/CMakeLists.txt index dcda44250f..dff9a60e40 100644 --- a/src/xwayland/lib/CMakeLists.txt +++ b/src/xwayland/lib/CMakeLists.txt @@ -14,5 +14,7 @@ ecm_qt_declare_logging_category(KWinXwaylandCommon Warning ) +set_property(TARGET KWinXwaylandCommon PROPERTY POSITION_INDEPENDENT_CODE ON) + target_include_directories(KWinXwaylandCommon PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) target_link_libraries(KWinXwaylandCommon Qt::Core Qt::Network)