Skip to content

Commit

Permalink
[build.zig] check if wayland-scanner is installed
Browse files Browse the repository at this point in the history
raysan5#4150 introduced a default value for linux_display_backend,
which makes X11-only systems fail to build.
  • Loading branch information
lnc3l0t committed Aug 6, 2024
1 parent 9c2ba3b commit ff409f2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,13 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.
}

if (options.linux_display_backend == .Wayland or options.linux_display_backend == .Both) {
_ = b.findProgram(&.{"wayland-scanner"}, &.{}) catch {
std.log.err(
\\ Wayland may not be installed on the system.
\\ You can switch to X11 in your `build.zig` by changing `Options.linux_display_backend`
, .{});
@panic("No Wayland");
};
raylib.defineCMacro("_GLFW_WAYLAND", null);
raylib.linkSystemLibrary("wayland-client");
raylib.linkSystemLibrary("wayland-cursor");
Expand Down

0 comments on commit ff409f2

Please sign in to comment.