-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.zig
58 lines (54 loc) · 1.53 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
const std = @import("std");
const Builder = std.build.Builder;
pub fn build(b: *Builder) void {
const target = b.standardTargetOptions(.{});
const s4 = b.dependency("s4", .{
.target = target,
// suppress current s4 UB
.optimize = .ReleaseFast,
});
const libgitz = b.dependency("libgitz", .{
.target = target,
});
const flog = b.addExecutable(.{
.name = "flog",
.target = target,
.root_source_file = .{ .path = "helper.zig" },
});
// expose s4's symbols to dynamically loaded (.so) modules
flog.rdynamic = true;
flog.install();
flog.installLibraryHeaders(s4.artifact("s4"));
flog.installLibraryHeaders(libgitz.artifact("gitz"));
flog.linkLibrary(s4.artifact("s4"));
flog.linkLibC();
flog.linkLibrary(libgitz.artifact("gitz"));
flog.addIncludePath(".");
flog.addCSourceFiles(&.{
"src/app.c",
"src/database.c",
"src/engine.c",
"src/file.c",
"src/flog.c",
"src/git.c",
"src/module.c",
"src/module-json.c",
"src/string.c",
"src/commands/base.c",
"src/commands/file.c",
"src/commands/help.c",
"src/commands/info.c",
"src/commands/install.c",
"src/commands/list.c",
"src/commands/script.c",
"src/commands/sync.c",
"src/commands/update.c",
"src/commands/with.c",
}, &.{
"-std=c11",
"-pedantic",
"-Wall",
"-W",
"-Wno-missing-field-initializers",
});
}