-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.zig
59 lines (50 loc) · 1.79 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
const std = @import("std");
pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
const VvmCore = b.createModule(.{
.root_source_file = b.path("core/Vvm.zig"),
.target = target,
.optimize = optimize,
});
const core_tests = b.addTest(.{
.root_source_file = b.path("core/Vvm.zig"),
.target = target,
.optimize = optimize,
});
const @"asm" = b.createModule(.{
.root_source_file = b.path("asm/asm.zig"),
.target = target,
.optimize = optimize,
});
@"asm".addImport("VvmCore", VvmCore);
const asm_tests = b.addTest(.{
.root_source_file = b.path("asm/asm.zig"),
.target = target,
.optimize = optimize,
});
asm_tests.root_module.addImport("VvmCore", VvmCore);
const system = b.addExecutable(.{
.name = "vvm",
.root_source_file = b.path("system/main.zig"),
.target = target,
.optimize = optimize,
});
system.root_module.addImport("VvmCore", VvmCore);
system.root_module.addImport("asm", @"asm");
b.installArtifact(system);
const system_tests = b.addTest(.{
.root_source_file = b.path("system/System.zig"),
.target = target,
.optimize = optimize,
});
system_tests.root_module.addImport("VvmCore", VvmCore);
system_tests.root_module.addImport("asm", @"asm");
const run_core_tests = b.addRunArtifact(core_tests);
const run_asm_tests = b.addRunArtifact(asm_tests);
const run_system_tests = b.addRunArtifact(system_tests);
const test_step = b.step("test", "Run unit tests");
test_step.dependOn(&run_core_tests.step);
test_step.dependOn(&run_asm_tests.step);
test_step.dependOn(&run_system_tests.step);
}