forked from alichraghi/zort
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.zig
29 lines (25 loc) · 927 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.Builder) !void {
const optimize = b.standardOptimizeOption(.{});
const target = b.standardTargetOptions(.{});
const bench = b.addExecutable(.{
.name = "bench",
.root_source_file = .{ .path = "bench/bench.zig" },
.optimize = optimize,
.target = target,
});
bench.addAnonymousModule("zort", .{ .source_file = .{ .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);
var tests = b.addTest(.{
.root_source_file = .{ .path = "src/test.zig" },
.optimize = optimize,
.target = target,
});
const test_step = b.step("test", "Run library tests");
test_step.dependOn(&b.addRunArtifact(tests).step);
}