Skip to content

Conversation

@hyperair
Copy link

@hyperair hyperair commented Dec 3, 2025

Fix the hyprwire_protocol cmake function, which is currently broken in a number of ways

  • Copy isClient logic from main CMakeLists.txt protocol function to handle the -client and -server suffixes in the generated filenames.
  • Separate protoName and protoFile parameters for when there's a mismatch between the protocol name in the XML file and the filename of the protocol.xml file.

- Copy isClient logic from main CMakeLists.txt protocol function
- Separate protoName and protoFile parameters for when there's a mismatch
@hyperair
Copy link
Author

hyperair commented Dec 3, 2025

Tested with the following CMakeLists.txt and the tests directory copied from this repo.

cmake_minimum_required(VERSION 3.19)
project(hyprwire_tests LANGUAGES CXX)

enable_testing()

set(CMAKE_CXX_STANDARD 23)
add_compile_options(
  -Wall
  -Wextra
  -Wpedantic
  -Wno-unused-parameter
  -Wno-unused-value
  -Wno-missing-field-initializers
  -Wno-narrowing
  -Wno-pointer-arith)

find_package(PkgConfig REQUIRED)
pkg_check_modules(hyprwire REQUIRED IMPORTED_TARGET hyprwire)

find_package(hyprwire-scanner REQUIRED)
include_directories(${CMAKE_BINARY_DIR})
link_libraries(PkgConfig::hyprwire)

add_executable(server tests/Server.cpp)
add_executable(client tests/Client.cpp)

set(generatedDir generated)

# needs https://github.com/hyprwm/hyprwire/pull/4
hyprwire_protocol(
  server
  FALSE
  "${generatedDir}"
  "test_protocol_v1"
  ${CMAKE_SOURCE_DIR}/tests
  "protocol-v1.xml"
)
hyprwire_protocol(
  client
  TRUE
  "${generatedDir}"
  "test_protocol_v1"
  ${CMAKE_SOURCE_DIR}/tests
  "protocol-v1.xml"
)

@vaxerski
Copy link
Member

vaxerski commented Dec 3, 2025

eh to be honest I'd nuke it anyways we dont use it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants