Optionally allow the system installation of wayland-protocols to be used (#1966)

This commit is contained in:
James Le Cuirot 2024-01-01 16:49:00 +00:00 committed by GitHub
parent faeeb7ec57
commit 8d14e7c6f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 6 deletions

View File

@ -129,8 +129,15 @@ endif()
if(WAYLAND_FOUND)
add_compile_definitions(SUNSHINE_BUILD_WAYLAND)
GEN_WAYLAND("wayland-protocols" "unstable/xdg-output" xdg-output-unstable-v1)
GEN_WAYLAND("wlr-protocols" "unstable" wlr-export-dmabuf-unstable-v1)
if(NOT SUNSHINE_SYSTEM_WAYLAND_PROTOCOLS)
set(WAYLAND_PROTOCOLS_DIR "${CMAKE_SOURCE_DIR}/third-party/wayland-protocols")
else()
pkg_get_variable(WAYLAND_PROTOCOLS_DIR wayland-protocols pkgdatadir)
pkg_check_modules(WAYLAND_PROTOCOLS wayland-protocols REQUIRED)
endif()
GEN_WAYLAND("${WAYLAND_PROTOCOLS_DIR}" "unstable/xdg-output" xdg-output-unstable-v1)
GEN_WAYLAND("${CMAKE_SOURCE_DIR}/third-party/wlr-protocols" "unstable" wlr-export-dmabuf-unstable-v1)
include_directories(
SYSTEM

View File

@ -5,17 +5,17 @@ macro(GEN_WAYLAND wayland_directory subdirectory filename)
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/generated-src)
message("wayland-scanner private-code \
${CMAKE_SOURCE_DIR}/third-party/${wayland_directory}/${subdirectory}/${filename}.xml \
${wayland_directory}/${subdirectory}/${filename}.xml \
${CMAKE_BINARY_DIR}/generated-src/${filename}.c")
message("wayland-scanner client-header \
${CMAKE_SOURCE_DIR}/third-party/${wayland_directory}/${subdirectory}/${filename}.xml \
${wayland_directory}/${subdirectory}/${filename}.xml \
${CMAKE_BINARY_DIR}/generated-src/${filename}.h")
execute_process(
COMMAND wayland-scanner private-code
${CMAKE_SOURCE_DIR}/third-party/${wayland_directory}/${subdirectory}/${filename}.xml
${wayland_directory}/${subdirectory}/${filename}.xml
${CMAKE_BINARY_DIR}/generated-src/${filename}.c
COMMAND wayland-scanner client-header
${CMAKE_SOURCE_DIR}/third-party/${wayland_directory}/${subdirectory}/${filename}.xml
${wayland_directory}/${subdirectory}/${filename}.xml
${CMAKE_BINARY_DIR}/generated-src/${filename}.h
RESULT_VARIABLE EXIT_INT

View File

@ -5,6 +5,7 @@ option(SUNSHINE_ENABLE_TRAY "Enable system tray icon. This option will be ignore
option(SUNSHINE_REQUIRE_TRAY "Require system tray icon. Fail the build if tray requirements are not met." ON)
option(SUNSHINE_SYSTEM_MINIUPNP "Use system installation of MiniUPnP rather than the submodule." OFF)
option(SUNSHINE_SYSTEM_WAYLAND_PROTOCOLS "Use system installation of wayland-protocols rather than the submodule." OFF)
if(APPLE)
option(SUNSHINE_CONFIGURE_PORTFILE