-
-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathbuild.zig
35 lines (26 loc) · 1.07 KB
/
build.zig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
const std = @import("std");
const Build = std.Build;
const Scanner = @import("zig-wayland").Scanner;
pub fn build(b: *Build) !void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
const scanner = Scanner.create(b, .{});
const wayland = b.createModule(.{ .root_source_file = scanner.result });
scanner.addSystemProtocol("stable/xdg-shell/xdg-shell.xml");
// Pass the maximum version implemented by your wayland server or client.
// Requests, events, enums, etc. from newer versions will not be generated,
// ensuring forwards compatibility with newer protocol xml.
scanner.generate("wl_compositor", 1);
scanner.generate("wl_shm", 1);
scanner.generate("xdg_wm_base", 1);
const exe = b.addExecutable(.{
.name = "hello-zig-wayland",
.root_source_file = b.path("hello.zig"),
.target = target,
.optimize = optimize,
});
exe.root_module.addImport("wayland", wayland);
exe.linkLibC();
exe.linkSystemLibrary("wayland-client");
b.installArtifact(exe);
}