From d9d2e1ce08c7fb103489ce4e57fca87e9b658737 Mon Sep 17 00:00:00 2001 From: James Le Cuirot Date: Sat, 30 May 2026 23:03:13 +0100 Subject: [PATCH 1/2] build(deps): libcap is mandatory on Linux now Signed-off-by: James Le Cuirot --- cmake/compile_definitions/linux.cmake | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/cmake/compile_definitions/linux.cmake b/cmake/compile_definitions/linux.cmake index 69b202db1e2..c0295c39a5e 100644 --- a/cmake/compile_definitions/linux.cmake +++ b/cmake/compile_definitions/linux.cmake @@ -89,21 +89,19 @@ endif() if(LIBDRM_FOUND) include_directories(SYSTEM ${LIBDRM_INCLUDE_DIRS}) list(APPEND PLATFORM_LIBRARIES ${LIBDRM_LIBRARIES}) + if(${SUNSHINE_ENABLE_DRM}) + add_compile_definitions(SUNSHINE_BUILD_DRM) + list(APPEND PLATFORM_TARGET_FILES + "${CMAKE_SOURCE_DIR}/src/platform/linux/kmsgrab.cpp") + list(APPEND SUNSHINE_DEFINITIONS EGL_NO_X11=1) + endif() endif() -# drm -if(${SUNSHINE_ENABLE_DRM}) +# Capabilities +if(LINUX) find_package(LIBCAP REQUIRED) -else() - set(LIBCAP_FOUND OFF) -endif() -if(LIBDRM_FOUND AND LIBCAP_FOUND) - add_compile_definitions(SUNSHINE_BUILD_DRM) include_directories(SYSTEM ${LIBCAP_INCLUDE_DIRS}) list(APPEND PLATFORM_LIBRARIES ${LIBCAP_LIBRARIES}) - list(APPEND PLATFORM_TARGET_FILES - "${CMAKE_SOURCE_DIR}/src/platform/linux/kmsgrab.cpp") - list(APPEND SUNSHINE_DEFINITIONS EGL_NO_X11=1) endif() # evdev From e62c4de878f9f0cc0b69638d18dacac0ecc2e261 Mon Sep 17 00:00:00 2001 From: James Le Cuirot Date: Sat, 30 May 2026 23:26:18 +0100 Subject: [PATCH 2/2] build(deps): fix use of libdrm headers when DRM capture is disabled Signed-off-by: James Le Cuirot --- cmake/compile_definitions/linux.cmake | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cmake/compile_definitions/linux.cmake b/cmake/compile_definitions/linux.cmake index c0295c39a5e..758e1e8465d 100644 --- a/cmake/compile_definitions/linux.cmake +++ b/cmake/compile_definitions/linux.cmake @@ -80,16 +80,18 @@ if(CUDA_FOUND) add_compile_definitions(SUNSHINE_BUILD_CUDA) endif() -# libdrm is required for DRM (KMS), KWin ScreenCast and Wayland -if(${SUNSHINE_ENABLE_DRM} OR ${SUNSHINE_ENABLE_KWIN} OR ${SUNSHINE_ENABLE_WAYLAND}) +# libdrm is required for DRM (KMS). Only the headers are required for Wayland, +# Vulkan, and PipeWire (KWin, Portal). +if(${SUNSHINE_ENABLE_DRM} OR ${SUNSHINE_ENABLE_WAYLAND} OR ${SUNSHINE_ENABLE_VULKAN} + OR ${SUNSHINE_ENABLE_KWIN} OR ${SUNSHINE_ENABLE_PORTAL}) find_package(LIBDRM REQUIRED) else() set(LIBDRM_FOUND OFF) endif() if(LIBDRM_FOUND) include_directories(SYSTEM ${LIBDRM_INCLUDE_DIRS}) - list(APPEND PLATFORM_LIBRARIES ${LIBDRM_LIBRARIES}) if(${SUNSHINE_ENABLE_DRM}) + list(APPEND PLATFORM_LIBRARIES ${LIBDRM_LIBRARIES}) add_compile_definitions(SUNSHINE_BUILD_DRM) list(APPEND PLATFORM_TARGET_FILES "${CMAKE_SOURCE_DIR}/src/platform/linux/kmsgrab.cpp")