fix building without the Wayland backend

The backend sources live in window/wayland and were picked up by the
global source glob, so a build with VOXELENGINE_WAYLAND=OFF (and any
non-Linux build, where the option is skipped entirely) tried to compile
them and failed on the generated protocol headers.

They are now collected separately and added to the target only when the
backend is enabled.

Also restores the CRLF line endings of Engine.cpp, GUI.hpp and
input.cpp, which were rewritten with LF and made their diffs look like
whole-file rewrites.
This commit is contained in:
alexei-zebra 2026-10-09 01:20:42 +03:00
parent 3b337241f5
commit 14fa7e5fd2
No known key found for this signature in database
GPG key ID: D19D450AC3D9A80E
4 changed files with 947 additions and 942 deletions

View file

@ -4,6 +4,10 @@ file(GLOB_RECURSE headers ${CMAKE_CURRENT_SOURCE_DIR}/*.hpp)
file(GLOB_RECURSE sources ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
list(REMOVE_ITEM sources ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp)
file(GLOB_RECURSE wayland_sources
${CMAKE_CURRENT_SOURCE_DIR}/window/wayland/*.cpp)
list(REMOVE_ITEM sources ${wayland_sources})
add_library(VoxelCoreSrc STATIC ${sources} ${headers})
find_package(OpenGL REQUIRED)
@ -120,7 +124,8 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND VOXELENGINE_WAYLAND)
# tablet is referenced by cursor-shape-v1
voxel_wayland_protocol(tablet-unstable-v2.xml tablet-unstable-v2)
target_sources(VoxelCoreSrc PRIVATE ${WAYLAND_SOURCES})
target_sources(
VoxelCoreSrc PRIVATE ${WAYLAND_SOURCES} ${wayland_sources})
target_include_directories(VoxelCoreSrc PUBLIC ${WAYLAND_GENERATED})
target_compile_definitions(VoxelCoreSrc PUBLIC VOXELENGINE_WAYLAND=1)
target_link_libraries(