forked from s-leroux/mongoz
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.zig
34 lines (29 loc) · 1.02 KB
/
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
34
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("mongoz", "src/main.zig");
lib.setBuildMode(mode);
lib.linkLibC();
lib.linkSystemLibrary("libmongoc-1.0");
lib.install();
//
// zig build test
//
const main_tests = b.addTest("src/main.zig");
main_tests.setBuildMode(mode);
main_tests.linkLibC();
main_tests.linkSystemLibrary("libmongoc-1.0");
//
// zig build install
// gdb --args zig-out/bin/test-exe zig
//
const main_test_exe = b.addTestExe("test-exe","src/main.zig");
main_test_exe.setBuildMode(mode);
main_test_exe.linkLibC();
main_test_exe.linkSystemLibrary("libmongoc-1.0");
main_test_exe.install();
const test_step = b.step("test", "Run library tests");
test_step.dependOn(&main_tests.step);
}