Skip to content

Commit

Permalink
Remove build-time dependency on X11
Browse files Browse the repository at this point in the history
  • Loading branch information
HildarTheDorf committed Aug 10, 2024
1 parent bcfdbde commit 9923081
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ project(WaylandExample)
find_package(ECM REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})

find_package(PkgConfig REQUIRED)
find_package(Vulkan REQUIRED COMPONENTS glslc)
find_package(Wayland REQUIRED COMPONENTS Client Cursor)
find_package(WaylandProtocols REQUIRED)
find_package(WaylandScanner REQUIRED)
find_package(X11 REQUIRED COMPONENTS xkbcommon)
pkg_check_modules(XKB REQUIRED IMPORTED_TARGET xkbcommon)

set(GLSLC_ARGS "--target-env=vulkan1.3" CACHE STRING "Additional arguments for glslc")

Expand Down Expand Up @@ -51,7 +52,7 @@ ecm_add_wayland_client_protocol(wayland_example PROTOCOL ${WaylandProtocols_DATA
set_target_properties(wayland_example PROPERTIES CXX_STANDARD 23)
target_compile_definitions(wayland_example PRIVATE GLM_FORCE_LEFT_HANDED VK_NO_PROTOTYPES VK_USE_PLATFORM_WAYLAND_KHR)
target_include_directories(wayland_example PRIVATE ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
target_link_libraries(wayland_example Wayland::Client Wayland::Cursor X11::xkbcommon)
target_link_libraries(wayland_example PkgConfig::XKB Wayland::Client Wayland::Cursor)

add_shader_target(all_shaders main.frag main.vert)
add_dependencies(wayland_example all_shaders)
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ Also required to build, but not used:

* No client side decoration support, only fullscreen is suppported if XDG Decoration is not provided by the compositor
* No support for animated cursors when Cursor Shape is not supported
* Build-time requirement on X11 headers/library being present

## Dependencies

* C/C++ compiler (tested with clang++ 18)
* CMake
* [Extra Cmake Modules](https://api.kde.org/frameworks/extra-cmake-modules/html/index.html) by KDE
* GLM headers
* pkg-config executable
* Vulkan SDK
* Vulkan headers
* VMA headers
Expand All @@ -48,7 +48,6 @@ Also required to build, but not used:
* unstable/xdg-decoration
* Wayland Scanner executable
* XKBCommon headers/library
* X11 headers/library

## Testing

Expand Down Expand Up @@ -77,5 +76,5 @@ This project is licensed under the MIT License - see the LICENSE.md file for det

## Acknowledgments

Members of the [Vulkan Discord](https://www.discord.gg/vulkan) for driving me insane with their questions to the point I wrote this project
#wayland on [OFTC](https://www.oftc.net/) IRC for their help in understanding the protocol
* Members of the [Vulkan Discord](https://www.discord.gg/vulkan) for driving me insane with their questions to the point I wrote this project
* #wayland on [OFTC](https://www.oftc.net/) IRC for their help in understanding the protocol

0 comments on commit 9923081

Please sign in to comment.