forked from Arwalk/zig-protobuf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.zig
30 lines (25 loc) · 971 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
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("zig-protobuf", "src/protobuf.zig");
lib.setBuildMode(mode);
lib.install();
var tests = [_]*std.build.LibExeObjStep{
b.addTest("src/protobuf.zig"),
b.addTest("src/tests.zig"),
b.addTest("tests/alltypes.zig"),
b.addTest("tests/tests_fixedsizes.zig"),
b.addTest("tests/tests_varints.zig")
};
const test_step = b.step("test", "Run library tests");
for(tests) |test_item| {
test_item.addPackage(.{
.name = "protobuf",
.path = std.build.FileSource{.path = "src/protobuf.zig"}
});
test_item.setBuildMode(mode);
test_step.dependOn(&test_item.step);
}
}