This repository has been archived by the owner on May 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.zig
73 lines (56 loc) · 2.51 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
const std = @import("std");
pub fn build(b: *std.build.Builder) void {
// Standard target options allows the person running `zig build` to choose
// what target to build for. Here we do not override the defaults, which
// means any target is allowed, and the default is native. Other options
// for restricting supported target set are available.
const target = b.standardTargetOptions(.{});
// Standard release options allow the person running `zig build` to select
// between Debug, ReleaseSafe, ReleaseFast, and ReleaseSmall.
const mode = b.standardReleaseOptions();
const example0 = b.addExecutable("example-0", "src/example-0.zig");
example0.linkSystemLibrary("gtk4");
example0.setTarget(target);
example0.setBuildMode(mode);
example0.install();
const example1 = b.addExecutable("example-1", "src/example-1.zig");
example1.linkSystemLibrary("gtk4");
example1.setTarget(target);
example1.setBuildMode(mode);
example1.install();
const example2 = b.addExecutable("example-2", "src/example-2.zig");
example2.linkSystemLibrary("gtk4");
example2.setTarget(target);
example2.setBuildMode(mode);
example2.install();
const example3 = b.addExecutable("example-3", "src/example-3.zig");
example3.linkSystemLibrary("gtk4");
example3.setTarget(target);
example3.setBuildMode(mode);
example3.install();
const example4 = b.addExecutable("example-4", "src/example-4.zig");
example4.linkSystemLibrary("gtk4");
example4.setTarget(target);
example4.setBuildMode(mode);
example4.install();
const run_cmd_0 = example0.run();
run_cmd_0.step.dependOn(b.getInstallStep());
const run_cmd_1 = example1.run();
run_cmd_1.step.dependOn(b.getInstallStep());
const run_cmd_2 = example2.run();
run_cmd_2.step.dependOn(b.getInstallStep());
const run_cmd_3 = example3.run();
run_cmd_3.step.dependOn(b.getInstallStep());
const run_cmd_4 = example4.run();
run_cmd_4.step.dependOn(b.getInstallStep());
const run_step_0 = b.step("example0", "Run example 0");
run_step_0.dependOn(&run_cmd_0.step);
const run_step_1 = b.step("example1", "Run example 1");
run_step_1.dependOn(&run_cmd_1.step);
const run_step_2 = b.step("example2", "Run example 2");
run_step_2.dependOn(&run_cmd_2.step);
const run_step_3 = b.step("example3", "Run example 3");
run_step_3.dependOn(&run_cmd_3.step);
const run_step_4 = b.step("example4", "Run example 4");
run_step_4.dependOn(&run_cmd_4.step);
}