diff options
author | Vaxry <[email protected]> | 2024-04-20 13:25:29 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2024-04-20 13:25:29 +0100 |
commit | ea954494024cb596aaf9a40c77c3e0fcaf0e0322 (patch) | |
tree | 8c35d1e5265608c7c2ec4f88eba66a79709466d1 /CMakeLists.txt | |
parent | 5c97b96278da672405527b84019ab50395a9f74f (diff) | |
download | Hyprland-ea954494024cb596aaf9a40c77c3e0fcaf0e0322.tar.gz Hyprland-ea954494024cb596aaf9a40c77c3e0fcaf0e0322.zip |
core: Move tearing to hyprwayland-scanner (#5657)
Adds a new dependency: hyprwayland-scanner https://github.com/hyprwm/hyprwayland-scanner
---------
Co-authored-by: Mihai Fufezan <[email protected]>
Diffstat (limited to 'CMakeLists.txt')
-rwxr-xr-x | CMakeLists.txt | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index b056402a..e5917e63 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -71,6 +71,7 @@ pkg_get_variable(WaylandScanner wayland-scanner wayland_scanner) message(STATUS "Found WaylandScanner at ${WaylandScanner}") pkg_get_variable(WAYLAND_PROTOCOLS_DIR wayland-protocols pkgdatadir) message(STATUS "Found wayland-protocols at ${WAYLAND_PROTOCOLS_DIR}") +find_program(HYPRWAYLAND_SCANNER NAMES hyprwayland-scanner REQUIRED) if(CMAKE_BUILD_TYPE MATCHES Debug OR CMAKE_BUILD_TYPE MATCHES DEBUG) message(STATUS "Configuring Hyprland in Debug with CMake") @@ -238,6 +239,19 @@ function(protocol protoPath protoName external) target_sources(Hyprland PRIVATE protocols/${protoName}-protocol.c) endif() endfunction() +function(protocolNew protoPath protoName external) + if (external) + execute_process( + COMMAND hyprwayland-scanner ${protoPath} ${CMAKE_SOURCE_DIR}/protocols/ + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) + target_sources(Hyprland PRIVATE protocols/${protoName}.cpp) + else() + execute_process( + COMMAND hyprwayland-scanner ${WAYLAND_PROTOCOLS_DIR}/${protoPath} ${CMAKE_SOURCE_DIR}/protocols/ + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) + target_sources(Hyprland PRIVATE protocols/${protoName}.cpp) + endif() +endfunction() target_link_libraries(Hyprland ${CMAKE_SOURCE_DIR}/subprojects/wlroots-hyprland/build/libwlroots.a @@ -260,10 +274,9 @@ protocol("stable/xdg-shell/xdg-shell.xml" "xdg-shell" false) protocol("unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml" "linux-dmabuf-unstable-v1" false) protocol("unstable/xdg-output/xdg-output-unstable-v1.xml" "xdg-output-unstable-v1" false) protocol("staging/fractional-scale/fractional-scale-v1.xml" "fractional-scale-v1" false) -protocol("staging/tearing-control/tearing-control-v1.xml" "tearing-control-v1" false) protocol("unstable/text-input/text-input-unstable-v1.xml" "text-input-unstable-v1" false) protocol("staging/cursor-shape/cursor-shape-v1.xml" "cursor-shape-v1" false) -protocol("staging/tearing-control/tearing-control-v1.xml" "tearing-control-v1" false) +protocolNew("staging/tearing-control/tearing-control-v1.xml" "tearing-control-v1" false) # tools add_subdirectory(hyprctl) |