-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.zig
More file actions
28 lines (22 loc) · 783 Bytes
/
build.zig
File metadata and controls
28 lines (22 loc) · 783 Bytes
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
const std = @import("std");
const Builder = std.build.Builder;
const Version = std.build.Version;
const LibExeObjStep = std.build.LibExeObjStep;
pub fn build(b: *Builder) void {
const mode = std.builtin.Mode.Debug;
const lib = b.addSharedLibrary("zigproc", "src/msgpack.zig", b.version(0, 0, 1));
set_build_options(lib);
lib.setBuildMode(mode);
// lib.setOutputDir("./");
lib.install();
const test_step = b.addTest("src/msgpack.zig");
const test_cmd = b.step("test", "Run the tests");
test_cmd.dependOn(&test_step.step);
set_build_options(test_step);
test_step.setBuildMode(mode);
b.default_step.dependOn(test_cmd);
}
fn set_build_options(step: *LibExeObjStep) void {
step.single_threaded = true;
step.force_pic = true;
}