autotests: Make test framework a static lib again

Static plugins being linked with shared libraries doesn't work smoothly.
POSITION_INDEPENDENT_CODE target property needs to be set for
every such plugin. However, there can be targets that we have no control
over, which need POSITION_INDEPENDENT_CODE to be set too. Asking such
projects to add this property and them refusing to do so would be
reasonable because kwin's entire static plugin pipeline is weird.

The test framework was made a shared library because kwin build
directory used to get really big (in 10s of gigabytes).

Due to the -fPIC issues, this change makes the test framework a static
lib again. Obviously, this brings back the big build directory problem.
But, it's not as terrible as it used to be. With this change, kwin build
directory is a couple of gigabytes in debug build, which is a lot but
not as bad as it used to be before.
remotes/origin/work/d_ed/frame_sync
Vlad Zahorodnii 3 years ago
parent 6d83ce30af
commit 16cc0f5ebb
  1. 11
      autotests/integration/CMakeLists.txt
  2. 18
      autotests/integration/effects/CMakeLists.txt
  3. 1
      src/plugins/CMakeLists.txt
  4. 1
      src/plugins/idletime/CMakeLists.txt
  5. 1
      src/plugins/kglobalaccel/CMakeLists.txt
  6. 1
      src/plugins/qpa/CMakeLists.txt
  7. 1
      src/plugins/windowsystem/CMakeLists.txt
  8. 1
      src/xwayland/CMakeLists.txt
  9. 2
      src/xwayland/lib/CMakeLists.txt

@ -1,6 +1,6 @@
add_subdirectory(helper)
add_library(KWinIntegrationTestFramework SHARED)
add_library(KWinIntegrationTestFramework STATIC)
qt6_generate_wayland_protocol_client_sources(KWinIntegrationTestFramework
NO_INCLUDE_CORE_ONLY
@ -43,16 +43,17 @@ target_link_libraries(KWinIntegrationTestFramework
KF6WindowSystemKWinPlugin
KF6IdleTimeKWinPlugin
)
kcoreaddons_target_static_plugins(KWinIntegrationTestFramework "kwin/effects/plugins" LINK_OPTION "PRIVATE")
set_target_properties(KWinIntegrationTestFramework PROPERTIES CXX_VISIBILITY_PRESET default)
function(integrationTest)
set(optionArgs)
set(optionArgs BUILTIN_EFFECTS)
set(oneValueArgs NAME)
set(multiValueArgs SRCS LIBS)
cmake_parse_arguments(ARGS "${optionArgs}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
add_executable(${ARGS_NAME} ${ARGS_SRCS})
target_link_libraries(${ARGS_NAME} KWinIntegrationTestFramework Qt::Test ${ARGS_LIBS})
if(${ARGS_BUILTIN_EFFECTS})
kcoreaddons_target_static_plugins(${ARGS_NAME} "kwin/effects/plugins")
endif()
add_test(NAME kwin-${ARGS_NAME} COMMAND dbus-run-session ${CMAKE_BINARY_DIR}/bin/${ARGS_NAME})
endfunction()
@ -92,7 +93,7 @@ integrationTest(NAME testLayerShellV1Window SRCS layershellv1window_test.cpp)
integrationTest(NAME testVirtualDesktop SRCS virtual_desktop_test.cpp)
integrationTest(NAME testXdgShellWindowRules SRCS xdgshellwindow_rules_test.cpp)
integrationTest(NAME testIdleInhibition SRCS idle_inhibition_test.cpp)
integrationTest(NAME testDontCrashReinitializeCompositor SRCS dont_crash_reinitialize_compositor.cpp)
integrationTest(NAME testDontCrashReinitializeCompositor SRCS dont_crash_reinitialize_compositor.cpp BUILTIN_EFFECTS)
integrationTest(NAME testNoGlobalShortcuts SRCS no_global_shortcuts_test.cpp)
integrationTest(NAME testPlacement SRCS placement_test.cpp)
integrationTest(NAME testActivation SRCS activation_test.cpp)

@ -1,9 +1,9 @@
integrationTest(NAME testTranslucency SRCS translucency_test.cpp LIBS XCB::ICCCM)
integrationTest(NAME testSlidingPopups SRCS slidingpopups_test.cpp LIBS XCB::ICCCM)
integrationTest(NAME testShadeWobblyWindows SRCS wobbly_shade_test.cpp LIBS XCB::ICCCM)
integrationTest(NAME testScriptedEffects SRCS scripted_effects_test.cpp)
integrationTest(NAME testToplevelOpenCloseAnimation SRCS toplevel_open_close_animation_test.cpp)
integrationTest(NAME testPopupOpenCloseAnimation SRCS popup_open_close_animation_test.cpp)
integrationTest(NAME testDesktopSwitchingAnimation SRCS desktop_switching_animation_test.cpp)
integrationTest(NAME testMinimizeAnimation SRCS minimize_animation_test.cpp)
integrationTest(NAME testMaximizeAnimation SRCS maximize_animation_test.cpp)
integrationTest(NAME testTranslucency SRCS translucency_test.cpp LIBS XCB::ICCCM BUILTIN_EFFECTS)
integrationTest(NAME testSlidingPopups SRCS slidingpopups_test.cpp LIBS XCB::ICCCM BUILTIN_EFFECTS)
integrationTest(NAME testShadeWobblyWindows SRCS wobbly_shade_test.cpp LIBS XCB::ICCCM BUILTIN_EFFECTS)
integrationTest(NAME testScriptedEffects SRCS scripted_effects_test.cpp BUILTIN_EFFECTS)
integrationTest(NAME testToplevelOpenCloseAnimation SRCS toplevel_open_close_animation_test.cpp BUILTIN_EFFECTS)
integrationTest(NAME testPopupOpenCloseAnimation SRCS popup_open_close_animation_test.cpp BUILTIN_EFFECTS)
integrationTest(NAME testDesktopSwitchingAnimation SRCS desktop_switching_animation_test.cpp BUILTIN_EFFECTS)
integrationTest(NAME testMinimizeAnimation SRCS minimize_animation_test.cpp BUILTIN_EFFECTS)
integrationTest(NAME testMaximizeAnimation SRCS maximize_animation_test.cpp BUILTIN_EFFECTS)

@ -26,7 +26,6 @@ endfunction()
macro(kwin_add_builtin_effect name)
kcoreaddons_add_plugin(${name} STATIC SOURCES ${ARGN} INSTALL_NAMESPACE "kwin/effects/plugins")
target_compile_definitions(${name} PRIVATE -DTRANSLATION_DOMAIN=\"kwin\")
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/builtin-effects/ RENAME ${name}.json)
endmacro()

@ -3,7 +3,6 @@ set(idletime_plugin_SRCS
)
add_library(KF6IdleTimeKWinPlugin OBJECT ${idletime_plugin_SRCS})
set_property(TARGET KF6IdleTimeKWinPlugin PROPERTY POSITION_INDEPENDENT_CODE ON)
target_compile_definitions(KF6IdleTimeKWinPlugin PRIVATE QT_STATICPLUGIN)
target_link_libraries(KF6IdleTimeKWinPlugin
KF6::IdleTime

@ -3,6 +3,5 @@ set(kglobalaccel_plugin_SRCS
)
add_library(KF6GlobalAccelKWinPlugin OBJECT ${kglobalaccel_plugin_SRCS})
set_property(TARGET KF6GlobalAccelKWinPlugin PROPERTY POSITION_INDEPENDENT_CODE ON)
target_compile_definitions(KF6GlobalAccelKWinPlugin PRIVATE QT_STATICPLUGIN)
target_link_libraries(KF6GlobalAccelKWinPlugin K::KGlobalAccelD kwin)

@ -1,5 +1,4 @@
add_library(KWinQpaPlugin OBJECT)
set_property(TARGET KWinQpaPlugin PROPERTY POSITION_INDEPENDENT_CODE ON)
target_sources(KWinQpaPlugin PRIVATE
backingstore.cpp
eglhelpers.cpp

@ -6,6 +6,5 @@ set(kwindowsystem_plugin_SRCS
)
add_library(KF6WindowSystemKWinPlugin OBJECT ${kwindowsystem_plugin_SRCS})
set_property(TARGET KF6WindowSystemKWinPlugin PROPERTY POSITION_INDEPENDENT_CODE ON)
target_compile_definitions(KF6WindowSystemKWinPlugin PRIVATE QT_STATICPLUGIN)
target_link_libraries(KF6WindowSystemKWinPlugin kwin)

@ -16,5 +16,4 @@ add_library(KWinXwaylandServerModule OBJECT
xwldrophandler.cpp
xwaylandlauncher.cpp
)
set_property(TARGET KWinXwaylandServerModule PROPERTY POSITION_INDEPENDENT_CODE ON)
target_link_libraries(KWinXwaylandServerModule PUBLIC kwin KWinXwaylandCommon)

@ -14,7 +14,5 @@ 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)

Loading…
Cancel
Save