-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.zig
More file actions
37 lines (29 loc) · 1012 Bytes
/
Copy pathbuild.zig
File metadata and controls
37 lines (29 loc) · 1012 Bytes
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
const std = @import("std");
const deps = @import("./deps.zig");
pub fn build(b: *std.build.Builder) void {
const target = b.standardTargetOptions(.{});
const mode = b.option(std.builtin.Mode, "mode", "") orelse .Debug;
const exe = b.addExecutable(.{
.name = "generate",
.root_source_file = .{ .path = "generate.zig" },
.target = target,
.optimize = mode,
});
deps.addAllTo(exe);
const run_cmd = b.addRunArtifact(exe);
run_cmd.step.dependOn(b.getInstallStep());
const run_step = b.step("run", "Run the app");
run_step.dependOn(&run_cmd.step);
//
const exe2 = b.addExecutable(.{
.name = "test",
.root_source_file = .{ .path = "test.zig" },
.target = target,
.optimize = mode,
});
deps.addAllTo(exe2);
const run_cmd2 = b.addRunArtifact(exe2);
run_cmd2.step.dependOn(b.getInstallStep());
const run_step2 = b.step("test", "Run the test");
run_step2.dependOn(&run_cmd2.step);
}