From 915d103128a8131a152613200172d2ff335c2a94 Mon Sep 17 00:00:00 2001 From: Neal Gompa Date: Sat, 13 Jul 2024 15:41:50 -0400 Subject: [PATCH] cmake: Allow not building kwin_x11 Some distributions do not wish to build the KWin X11 backend as they do not use it, even though they wish to maintain X11 support for Xwayland when using KWin as a Wayland compositor. Allow this choice by splitting the build flag and setting it up to forcibly disable building the backend when building X11 code is switched off. --- CMakeLists.txt | 11 +++++++++-- src/backends/CMakeLists.txt | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a2dda88a23..9c93a038e3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -48,7 +48,8 @@ option(KWIN_BUILD_KCMS "Enable building of KWin configuration modules." ON) option(KWIN_BUILD_NOTIFICATIONS "Enable building of KWin with knotifications support" ON) option(KWIN_BUILD_SCREENLOCKER "Enable building of KWin lockscreen functionality" ON) option(KWIN_BUILD_TABBOX "Enable building of KWin Tabbox functionality" ON) -option(KWIN_BUILD_X11 "Enable building kwin_x11 and Xwayland support" ON) +option(KWIN_BUILD_X11 "Enable building X11 common code and Xwayland support" ON) +option(KWIN_BUILD_X11_BACKEND "Enable building kwin_x11" ON) option(KWIN_BUILD_GLOBALSHORTCUTS "Enable building of KWin with global shortcuts support" ON) option(KWIN_BUILD_RUNNERS "Enable building of KWin with krunner support" ON) @@ -281,6 +282,8 @@ if (KWIN_BUILD_X11) # for kwin internal things set(HAVE_X11_XCB ${X11_XCB_FOUND}) +else() + set(KWIN_BUILD_X11_BACKEND OFF CACHE BOOL "Enable building kwin_x11" FORCE) endif() find_package(Libinput 1.19) @@ -493,7 +496,11 @@ configure_package_config_file(KWinDBusInterfaceConfig.cmake.in install(FILES ${CMAKE_CURRENT_BINARY_DIR}/KWinDBusInterfaceConfig.cmake DESTINATION ${CMAKECONFIG_INSTALL_DIR}) -ecm_install_configured_files(INPUT plasma-kwin_x11.service.in plasma-kwin_wayland.service.in @ONLY +ecm_install_configured_files(INPUT plasma-kwin_wayland.service.in @ONLY DESTINATION ${KDE_INSTALL_SYSTEMDUSERUNITDIR}) +if (KWIN_BUILD_X11_BACKEND) + ecm_install_configured_files(INPUT plasma-kwin_x11.service.in @ONLY + DESTINATION ${KDE_INSTALL_SYSTEMDUSERUNITDIR}) +endif() ki18n_install(po) diff --git a/src/backends/CMakeLists.txt b/src/backends/CMakeLists.txt index e734828df5..cccd1f5736 100644 --- a/src/backends/CMakeLists.txt +++ b/src/backends/CMakeLists.txt @@ -4,6 +4,6 @@ add_subdirectory(libinput) add_subdirectory(virtual) add_subdirectory(wayland) -if (KWIN_BUILD_X11) +if (KWIN_BUILD_X11_BACKEND) add_subdirectory(x11) endif()