-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.zig
39 lines (32 loc) · 1.11 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");
const builtin = @import("builtin");
pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const mode = b.standardOptimizeOption(.{});
const exe = b.addExecutable(.{
.name = "zacho",
.root_source_file = b.path("src/main.zig"),
.target = target,
.optimize = mode,
});
if (comptime builtin.target.isDarwin()) {
const zig_kit = b.dependency("zigkit", .{
.target = target,
.optimize = mode,
});
exe.root_module.addImport("ZigKit", zig_kit.module("ZigKit"));
if (b.sysroot) |sysroot| {
exe.addSystemFrameworkPath(.{ .cwd_relative = b.pathJoin(&.{ sysroot, "/System/Library/Frameworks" }) });
}
exe.linkFramework("CoreFoundation");
exe.linkFramework("Security");
}
b.installArtifact(exe);
const run_cmd = b.addRunArtifact(exe);
run_cmd.step.dependOn(b.getInstallStep());
if (b.args) |args| {
run_cmd.addArgs(args);
}
const run_step = b.step("run", "Run the app");
run_step.dependOn(&run_cmd.step);
}