-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathbuild.zig
33 lines (28 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
30
31
32
33
const std = @import("std");
const builtin = @import("builtin");
const Builder = std.build.Builder;
pub fn build(b: *Builder) void {
const mode = b.standardReleaseOptions();
const tests = b.addTest("src/okredis.zig");
tests.setBuildMode(mode);
tests.setNamePrefix("debug test");
const test_step = b.step("test", "Run all tests in debug mode.");
test_step.dependOn(&tests.step);
const build_docs = b.addSystemCommand(&[_][]const u8{
b.zig_exe,
"test",
"src/okredis.zig",
// "-target",
// "x86_64-linux",
"-femit-docs",
"-fno-emit-bin",
"--output-dir",
".",
});
const all_step = b.step("all", "Builds docs and runs all tests");
const docs = b.step("docs", "Builds docs");
docs.dependOn(&build_docs.step);
all_step.dependOn(test_step);
all_step.dependOn(docs);
b.default_step.dependOn(docs);
}