-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.zig
34 lines (30 loc) · 866 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
31
32
33
34
const std = @import("std");
pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{ .preferred_optimize_mode = .ReleaseFast });
const strip = b.option(bool, "strip", "Strip symbols from the binary. Default: false") orelse false;
// Create the executable
const bin = b.addExecutable(.{
.name = "sxpsnr",
.target = target,
.link_libc = true,
.optimize = optimize,
.strip = strip,
});
// Add C source files
bin.addCSourceFiles(.{
.files = &.{
"src/main.c",
"src/util.c",
"src/xpsnr.c",
},
.flags = &.{
"-std=c99",
"-lm",
"-Wall",
"-Wextra",
"-Wpedantic",
},
});
b.installArtifact(bin);
}