-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.zig
More file actions
41 lines (33 loc) · 1.28 KB
/
build.zig
File metadata and controls
41 lines (33 loc) · 1.28 KB
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
36
37
38
39
40
41
const std = @import("std");
const Scanner = @import("wayland").Scanner;
pub fn build(b: *std.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.addCustomProtocol(b.path("./protocols/input-method-unstable-v2.xml"));
scanner.addCustomProtocol(b.path("./protocols/text-input-unstable-v3.xml"));
scanner.generate("wl_seat", 2);
scanner.generate("zwp_input_method_manager_v2", 1);
scanner.generate("zwp_text_input_manager_v3", 1);
const exe = b.addExecutable(.{
.name = "zw-type",
.root_module = b.createModule(.{
.root_source_file = b.path("src/main.zig"),
.target = target,
.optimize = optimize,
.strip = true,
}),
});
exe.linkLibC();
exe.root_module.addImport("wayland", wayland);
exe.linkSystemLibrary("wayland-client");
b.installArtifact(exe);
const run_step = b.step("run", "Run the program");
const run_cmd = b.addRunArtifact(exe);
run_step.dependOn(&run_cmd.step);
run_cmd.step.dependOn(b.getInstallStep());
if (b.args) |args| {
run_cmd.addArgs(args);
}
}