mirror of
https://github.com/Almamu/linux-wallpaperengine.git
synced 2025-07-14 13:22:23 +08:00
Build protocols in cmake
This commit is contained in:
parent
4e03774cf8
commit
c84ec9aedd
@ -47,16 +47,35 @@ include_directories(
|
|||||||
if (ENABLE_WAYLAND)
|
if (ENABLE_WAYLAND)
|
||||||
message(STATUS "Wayland support is enabled!")
|
message(STATUS "Wayland support is enabled!")
|
||||||
|
|
||||||
|
pkg_check_modules(wayland-cursor wayland-protocols egl wayland-egl)
|
||||||
|
|
||||||
|
find_program(WaylandScanner NAMES wayland-scanner)
|
||||||
|
message(STATUS "Found WaylandScanner at ${WaylandScanner}")
|
||||||
|
execute_process(
|
||||||
|
COMMAND pkg-config --variable=pkgdatadir wayland-protocols
|
||||||
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||||
|
OUTPUT_VARIABLE WAYLAND_PROTOCOLS_DIR
|
||||||
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
|
message(STATUS "Found wayland-protocols at ${WAYLAND_PROTOCOLS_DIR}")
|
||||||
|
|
||||||
message(STATUS "Building protocols...")
|
message(STATUS "Building protocols...")
|
||||||
execute_process(
|
execute_process(
|
||||||
COMMAND ./protocols.sh
|
COMMAND ${WaylandScanner} client-header ${CMAKE_SOURCE_DIR}/protocols/wlr-layer-shell-unstable-v1.xml wlr-layer-shell-unstable-v1-protocol.h
|
||||||
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
|
||||||
|
execute_process(
|
||||||
|
COMMAND ${WaylandScanner} private-code ${CMAKE_SOURCE_DIR}/protocols/wlr-layer-shell-unstable-v1.xml wlr-layer-shell-unstable-v1-protocol.c
|
||||||
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
|
||||||
|
execute_process(
|
||||||
|
COMMAND ${WaylandScanner} client-header ${WAYLAND_PROTOCOLS_DIR}/stable/xdg-shell/xdg-shell.xml xdg-shell-protocol.h
|
||||||
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
|
||||||
|
execute_process(
|
||||||
|
COMMAND ${WaylandScanner} private-code ${WAYLAND_PROTOCOLS_DIR}/stable/xdg-shell/xdg-shell.xml xdg-shell-protocol.c
|
||||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
|
||||||
|
|
||||||
pkg_check_modules(wayland-cursor wayland-protocols egl wayland-egl)
|
|
||||||
|
|
||||||
add_compile_definitions(ENABLE_WAYLAND)
|
add_compile_definitions(ENABLE_WAYLAND)
|
||||||
set(WAYLAND_SOURCES "src/WallpaperEngine/Render/Drivers/CWaylandOpenGLDriver.h" "src/WallpaperEngine/Render/Drivers/CWaylandOpenGLDriver.cpp" "src/WallpaperEngine/Render/Drivers/Detectors/CWaylandFullScreenDetector.cpp"
|
set(WAYLAND_SOURCES "src/WallpaperEngine/Render/Drivers/CWaylandOpenGLDriver.h" "src/WallpaperEngine/Render/Drivers/CWaylandOpenGLDriver.cpp" "src/WallpaperEngine/Render/Drivers/Detectors/CWaylandFullScreenDetector.cpp"
|
||||||
"src/WallpaperEngine/Render/Drivers/Detectors/CWaylandFullScreenDetector.h" "src/WallpaperEngine/Render/Drivers/Output/CWaylandOutput.cpp" "src/WallpaperEngine/Render/Drivers/Output/CWaylandOutput.h")
|
"src/WallpaperEngine/Render/Drivers/Detectors/CWaylandFullScreenDetector.h" "src/WallpaperEngine/Render/Drivers/Output/CWaylandOutput.cpp" "src/WallpaperEngine/Render/Drivers/Output/CWaylandOutput.h"
|
||||||
|
"xdg-shell-protocol.c" "wlr-layer-shell-unstable-v1-protocol.c")
|
||||||
else()
|
else()
|
||||||
set(WAYLAND_SOURCES "")
|
set(WAYLAND_SOURCES "")
|
||||||
endif()
|
endif()
|
||||||
|
@ -1,9 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
$(pkg-config --variable=wayland_scanner wayland-scanner) client-header protocols/wlr-layer-shell-unstable-v1.xml wlr-layer-shell-unstable-v1-protocol.h
|
|
||||||
$(pkg-config --variable=wayland_scanner wayland-scanner) private-code protocols/wlr-layer-shell-unstable-v1.xml wlr-layer-shell-unstable-v1-protocol.c
|
|
||||||
$(pkg-config --variable=wayland_scanner wayland-scanner) client-header $(pkg-config --variable=pkgdatadir wayland-protocols)/stable/xdg-shell/xdg-shell.xml xdg-shell-protocol.h
|
|
||||||
$(pkg-config --variable=wayland_scanner wayland-scanner) private-code $(pkg-config --variable=pkgdatadir wayland-protocols)/stable/xdg-shell/xdg-shell.xml xdg-shell-protocol.c
|
|
||||||
|
|
||||||
cc -c -I. -std=c99 -lwayland-client -Wall -Wextra -Werror -Wno-unused-parameter -Wno-sign-compare -Wno-unused-function -Wno-unused-variable -Wno-unused-result -Wdeclaration-after-statement wlr-layer-shell-unstable-v1-protocol.c -o wlr-layer-shell-unstable-v1-protocol.o
|
|
||||||
cc -c -I. -std=c99 -lwayland-client -Wall -Wextra -Werror -Wno-unused-parameter -Wno-sign-compare -Wno-unused-function -Wno-unused-variable -Wno-unused-result -Wdeclaration-after-statement xdg-shell-protocol.c -o xdg-shell-protocol.o
|
|
Loading…
Reference in New Issue
Block a user