-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathbuild.zig
More file actions
24 lines (20 loc) · 746 Bytes
/
build.zig
File metadata and controls
24 lines (20 loc) · 746 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
const std = @import("std");
const deps = @import("./deps.zig");
pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const mode = b.option(std.builtin.Mode, "mode", "") orelse .Debug;
const disable_llvm = b.option(bool, "disable_llvm", "use the non-llvm zig codegen") orelse false;
const t = b.addTest(.{
.root_source_file = b.path("test.zig"),
.target = target,
.optimize = mode,
});
deps.addAllTo(t);
t.use_llvm = !disable_llvm;
t.use_lld = !disable_llvm;
const run_t = b.addRunArtifact(t);
run_t.setCwd(b.path("."));
run_t.has_side_effects = true;
const t_step = b.step("test", "Run all library tests");
t_step.dependOn(&run_t.step);
}