-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.zig
More file actions
46 lines (37 loc) · 1.23 KB
/
Copy pathbuild.zig
File metadata and controls
46 lines (37 loc) · 1.23 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
42
43
44
45
46
const std = @import("std");
pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
const mod_zig80 = b.addModule("zig80", .{
.root_source_file = b.path("lib/Z80.zig"),
.target = target,
.optimize = optimize,
});
const mod_test = b.createModule(.{
.root_source_file = b.path("tests/test_runner.zig"),
.target = target,
.optimize = optimize,
.imports = &.{
.{ .name = "zig80", .module = mod_zig80 },
},
});
const exe_test = b.addExecutable(.{
.name = "zig80_test",
.root_module = mod_test,
});
b.installArtifact(exe_test);
const run_step_test = b.step("test", "Test runner");
const run_cmd_test = b.addRunArtifact(exe_test);
run_step_test.dependOn(&run_cmd_test.step);
run_cmd_test.step.dependOn(b.getInstallStep());
if (b.args) |args| {
run_cmd_test.addArgs(args);
}
// "check" step used by ZLS for Build-On-Save.
const check = b.step("check", "Check compilation");
const exe_check = b.addExecutable(.{
.name = "check",
.root_module = mod_test,
});
check.dependOn(&exe_check.step);
}