-
Notifications
You must be signed in to change notification settings - Fork 6
/
build.zig
29 lines (25 loc) · 923 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
const std = @import("std");
pub fn build(b: *std.Build) !void {
const optimize = b.standardOptimizeOption(.{});
const target = b.standardTargetOptions(.{});
const bench = b.addExecutable(.{
.name = "bench",
.root_source_file = b.path("bench/bench.zig"),
.optimize = optimize,
.target = target,
});
bench.root_module.addAnonymousImport("zort", .{ .root_source_file = b.path("src/main.zig") });
const bench_cmd = b.addRunArtifact(bench);
if (b.args) |args| {
bench_cmd.addArgs(args);
}
const bench_step = b.step("bench", "Run benchmarks");
bench_step.dependOn(&bench_cmd.step);
const tests = b.addTest(.{
.root_source_file = b.path("src/test.zig"),
.optimize = optimize,
.target = target,
});
const test_step = b.step("test", "Run library tests");
test_step.dependOn(&b.addRunArtifact(tests).step);
}