-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.zig
31 lines (24 loc) · 936 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
const std = @import("std");
const Builder = std.build.Builder;
const CrossTarget = std.zig.CrossTarget;
const builtin = std.builtin;
pub fn build(builder: *Builder) void {
const mode = builder.standardReleaseOptions();
const target = builder.standardTargetOptions(.{});
addMainStep(builder, mode, target);
}
fn addMainStep(builder: *Builder, mode: builtin.Mode, target: CrossTarget) void {
const main_exe_step = builder.addExecutable("lapp", "src/main.zig");
main_exe_step.setBuildMode(mode);
main_exe_step.setTarget(target);
main_exe_step.addPackagePath("thirdparty/zig-clap", "thirdparty/zig-clap/clap.zig");
main_exe_step.linkLibC();
main_exe_step.linkSystemLibrary("argon2");
if (main_exe_step.build_mode == .Debug) {
main_exe_step.valgrind_support = true;
} else {
main_exe_step.strip = true;
main_exe_step.pie = true;
}
main_exe_step.install();
}