mirror of
				https://github.com/raysan5/raylib.git
				synced 2025-11-04 01:34:19 +00:00 
			
		
		
		
	[build.zig] check if wayland-scanner is installed (#4217)
#4150 introduced a default value for linux_display_backend, which makes X11-only systems fail to build.
This commit is contained in:
		@@ -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) {
 | 
					                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.defineCMacro("_GLFW_WAYLAND", null);
 | 
				
			||||||
                    raylib.linkSystemLibrary("wayland-client");
 | 
					                    raylib.linkSystemLibrary("wayland-client");
 | 
				
			||||||
                    raylib.linkSystemLibrary("wayland-cursor");
 | 
					                    raylib.linkSystemLibrary("wayland-cursor");
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user