diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt index bd76708a..a19a1e43 100644 --- a/client/CMakeLists.txt +++ b/client/CMakeLists.txt @@ -41,6 +41,9 @@ add_feature_info(ENABLE_X11 ENABLE_X11 "X11 support.") option(ENABLE_WAYLAND "Build with Wayland support" ON) add_feature_info(ENABLE_WAYLAND ENABLE_WAYLAND "Wayland support.") +option(ENABLE_LIBDECOR "Build with libdecor support" OFF) +add_feature_info(ENABLE_LIBDECOR ENABLE_LIBDECOR "libdecor support.") + if (NOT ENABLE_SDL AND NOT ENABLE_X11 AND NOT ENABLE_WAYLAND) message(FATAL_ERROR "One of ENABLE_SDL, ENABLE_X11, or ENABLE_WAYLAND must be on") endif() diff --git a/client/displayservers/Wayland/CMakeLists.txt b/client/displayservers/Wayland/CMakeLists.txt index 52e7f1fe..ed88de7e 100644 --- a/client/displayservers/Wayland/CMakeLists.txt +++ b/client/displayservers/Wayland/CMakeLists.txt @@ -9,6 +9,20 @@ pkg_check_modules(DISPLAYSERVER_Wayland_PKGCONFIG REQUIRED #pkg_check_modules(DISPLAYSERVER_Wayland_OPT_PKGCONFIG #) +set(displayserver_Wayland_SHELL_SRC "") + +if (ENABLE_LIBDECOR) + pkg_check_modules(DISPLAYSERVER_Wayland_LIBDECOR REQUIRED + libdecor-0.1 + ) + list(APPEND DISPLAYSERVER_Wayland_PKGCONFIG_LIBRARIES ${DISPLAYSERVER_Wayland_LIBDECOR_LIBRARIES}) + list(APPEND DISPLAYSERVER_Wayland_PKGCONFIG_INCLUDE_DIRS ${DISPLAYSERVER_Wayland_LIBDECOR_INCLUDE_DIRS}) + list(APPEND displayserver_Wayland_SHELL_SRC shell_libdecor.c) + add_definitions(-D ENABLE_LIBDECOR) +else() + list(APPEND displayserver_Wayland_SHELL_SRC shell_xdg.c) +endif() + add_library(displayserver_Wayland STATIC clipboard.c cursor.c @@ -19,9 +33,9 @@ add_library(displayserver_Wayland STATIC poll.c state.c registry.c - shell_xdg.c wayland.c window.c + ${displayserver_Wayland_SHELL_SRC} ) target_link_libraries(displayserver_Wayland