forked from Hejsil/mecha
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.zig
More file actions
32 lines (28 loc) · 955 Bytes
/
Copy pathbuild.zig
File metadata and controls
32 lines (28 loc) · 955 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
const builtin = @import("builtin");
const std = @import("std");
pub fn build(b: *std.Build) void {
const optimize = b.standardOptimizeOption(.{});
const target = b.standardTargetOptions(.{});
const module = b.addModule("mecha", .{
.root_source_file = b.path("mecha.zig"),
});
const test_step = b.step("test", "Run all tests in all modes.");
for ([_][]const u8{
"mecha.zig",
"example/rgb.zig",
"example/json.zig",
"example/math.zig",
}) |test_file| {
const tests = b.addTest(.{
.root_module = b.createModule(.{
.root_source_file = b.path(test_file),
.optimize = optimize,
.target = target,
}),
});
const run_tests = b.addRunArtifact(tests);
tests.root_module.addImport("mecha", module);
test_step.dependOn(&run_tests.step);
}
b.default_step.dependOn(test_step);
}