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.
This commit is contained in:
Neal Gompa 2024-07-13 15:41:50 -04:00 committed by Vlad Zahorodnii
parent 7c978e84c1
commit 915d103128
2 changed files with 10 additions and 3 deletions

View file

@ -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)

View file

@ -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()