build(deps): use submodules for wayland protocols (#1731)

This commit is contained in:
ReenigneArcher
2023-10-10 16:13:52 -04:00
committed by GitHub
parent 395d572b17
commit f1cd94638f
8 changed files with 18 additions and 430 deletions

View File

@@ -127,8 +127,8 @@ endif()
if(WAYLAND_FOUND)
add_compile_definitions(SUNSHINE_BUILD_WAYLAND)
GEN_WAYLAND(xdg-output-unstable-v1)
GEN_WAYLAND(wlr-export-dmabuf-unstable-v1)
GEN_WAYLAND("wayland-protocols" "unstable/xdg-output" xdg-output-unstable-v1)
GEN_WAYLAND("wlr-protocols" "unstable" wlr-export-dmabuf-unstable-v1)
include_directories(
SYSTEM

View File

@@ -1,21 +1,21 @@
# linux specific macros
# GEN_WAYLAND: args = `filename`
macro(GEN_WAYLAND filename)
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-protocols/${filename}.xml \
${CMAKE_SOURCE_DIR}/third-party/${wayland_directory}/${subdirectory}/${filename}.xml \
${CMAKE_BINARY_DIR}/generated-src/${filename}.c")
message("wayland-scanner client-header \
${CMAKE_SOURCE_DIR}/third-party/wayland-protocols/${filename}.xml \
${CMAKE_SOURCE_DIR}/third-party/${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-protocols/${filename}.xml
${CMAKE_SOURCE_DIR}/third-party/${wayland_directory}/${subdirectory}/${filename}.xml
${CMAKE_BINARY_DIR}/generated-src/${filename}.c
COMMAND wayland-scanner client-header
${CMAKE_SOURCE_DIR}/third-party/wayland-protocols/${filename}.xml
${CMAKE_SOURCE_DIR}/third-party/${wayland_directory}/${subdirectory}/${filename}.xml
${CMAKE_BINARY_DIR}/generated-src/${filename}.h
RESULT_VARIABLE EXIT_INT