autotests: Use a shared library for the integration test framework

Ever since the effects were changed to static, each test of the
integration tests includes all the effects. The result of this is that
when doing a debug build each test is now 60MiB or more. With the amount
of tests, this results in ~8 GiB of diskspace used just for KWin's
binary output directory, which is rather excessive.

Since the tests all share a common framework library, we can change that
library to a shared library and that way avoid linking all the effects
into each test.

Most of this is shuffling around some link libraries in the integration
test CMakeLists, however, I needed to export the Xwayland class as it is
used by one of the tests but wasn't exported.
master
Arjen Hiemstra 3 years ago
parent cbad78a360
commit e5ca5df0c5

@ -40,23 +40,26 @@ ecm_add_qtwayland_client_protocol(KWinIntegrationTestFramework_SOURCES
BASENAME kde-output-management-v2
)
add_library(KWinIntegrationTestFramework STATIC ${KWinIntegrationTestFramework_SOURCES})
add_library(KWinIntegrationTestFramework SHARED ${KWinIntegrationTestFramework_SOURCES})
target_link_libraries(KWinIntegrationTestFramework
Qt::Test
KF5::WaylandClient
kwin4_effect_builtins
kwin
Wayland::Client
PUBLIC
Qt::Test
KF5::WaylandClient
Wayland::Client
kwin
# Own libraries
KWinXwaylandServerModule
PRIVATE
kwin4_effect_builtins
# Own libraries
KWinXwaylandServerModule
# Static plugins
KWinQpaPlugin
KF5GlobalAccelKWinPlugin
KF5WindowSystemKWinPlugin
KF5IdleTimeKWinPlugin
# Static plugins
KWinQpaPlugin
KF5GlobalAccelKWinPlugin
KF5WindowSystemKWinPlugin
KF5IdleTimeKWinPlugin
)
set_target_properties(KWinIntegrationTestFramework PROPERTIES CXX_VISIBILITY_PRESET default)
function(integrationTest)
set(optionArgs WAYLAND_ONLY)
@ -64,12 +67,12 @@ function(integrationTest)
set(multiValueArgs SRCS LIBS)
cmake_parse_arguments(ARGS "${optionArgs}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
add_executable(${ARGS_NAME} ${ARGS_SRCS})
target_link_libraries(${ARGS_NAME} KWinIntegrationTestFramework kwin Qt::Test ${ARGS_LIBS})
target_link_libraries(${ARGS_NAME} KWinIntegrationTestFramework Qt::Test ${ARGS_LIBS})
add_test(NAME kwin-${ARGS_NAME} COMMAND dbus-run-session ${CMAKE_BINARY_DIR}/bin/${ARGS_NAME})
if (${ARGS_WAYLAND_ONLY})
add_executable(${ARGS_NAME}_waylandonly ${ARGS_SRCS} )
set_target_properties(${ARGS_NAME}_waylandonly PROPERTIES COMPILE_DEFINITIONS "NO_XWAYLAND")
target_link_libraries(${ARGS_NAME}_waylandonly KWinIntegrationTestFramework kwin Qt::Test ${ARGS_LIBS})
target_link_libraries(${ARGS_NAME}_waylandonly KWinIntegrationTestFramework Qt::Test ${ARGS_LIBS})
add_test(NAME kwin-${ARGS_NAME}-waylandonly COMMAND dbus-run-session ${CMAKE_BINARY_DIR}/bin/${ARGS_NAME}_waylandonly)
endif()
endfunction()

@ -27,7 +27,7 @@ class XwaylandSocket;
namespace Xwl
{
class Xwayland : public XwaylandInterface
class KWIN_EXPORT Xwayland : public XwaylandInterface
{
Q_OBJECT

Loading…
Cancel
Save