forked from gianni-rosato/vac-enc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.zig
39 lines (33 loc) · 1.05 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
const std = @import("std");
pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const strip = b.option(bool, "strip", "Whether to strip symbols from the binary, defaults to true") orelse true;
const bin = b.addExecutable(.{
.name = "vac-enc",
.target = target,
.optimize = .ReleaseFast, // Enforce ReleaseFast as the default
.link_libc = true,
.strip = strip,
});
// If using Windows, add the include path for the win32 directory
if (target.result.os.tag == .windows) {
bin.addIncludePath(b.path("win32"));
}
bin.addCSourceFiles(.{
.files = &.{
"src/decode.c",
"src/flac.c",
"src/main.c",
"src/unicode_support.c",
"src/wavreader.c",
},
.flags = &.{
"-std=c99",
"-D_POSIX_C_SOURCE=200809L",
},
});
bin.linkSystemLibrary("libopusenc");
bin.linkSystemLibrary("opus");
bin.linkSystemLibrary("soxr");
b.installArtifact(bin);
}