-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.zig
33 lines (25 loc) · 997 Bytes
/
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
const std = @import("std");
pub fn build(b: *std.build.Builder) void {
// Standard release options allow the person running `zig build` to select
// between Debug, ReleaseSafe, ReleaseFast, and ReleaseSmall.
const mode = b.standardReleaseOptions();
const lib = b.addStaticLibrary("etch", "src/main.zig");
lib.setBuildMode(mode);
lib.install();
var main_tests = b.addTest("src/main.zig");
main_tests.setBuildMode(mode);
const test_step = b.step("test", "Run library tests");
test_step.dependOn(&main_tests.step);
const target = b.standardTargetOptions(.{});
const exe = b.addExecutable("bench", "src/bench.zig");
exe.setTarget(target);
exe.setBuildMode(mode);
// exe.install();
const bench_cmd = exe.run();
bench_cmd.step.dependOn(b.getInstallStep());
if (b.args) |args| {
bench_cmd.addArgs(args);
}
const bench_step = b.step("bench", "Run the benchmarks");
bench_step.dependOn(&bench_cmd.step);
}