-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.zig
More file actions
30 lines (26 loc) · 1017 Bytes
/
build.zig
File metadata and controls
30 lines (26 loc) · 1017 Bytes
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
const std = @import("std");
pub fn build(b: *std.Build) !void {
const optimize = b.standardOptimizeOption(.{});
const target = b.standardTargetOptions(.{});
const add_paths = b.option(bool, "add-paths", "add macos SDK paths from dependency") orelse false;
const objz = b.addModule("objz", .{
.root_source_file = b.path("src/lib.zig"),
.target = target,
.optimize = optimize,
});
if (add_paths) b.lazyImport(@This(), "macos_sdk").?.addPathsModule(objz);
objz.linkSystemLibrary("objc", .{});
objz.linkFramework("Foundation", .{});
const tests = b.addTest(.{
.root_module = b.createModule(.{
.root_source_file = b.path("src/lib.zig"),
.target = target,
.optimize = optimize,
}),
});
tests.linkSystemLibrary("objc");
tests.linkFramework("Foundation");
const test_step = b.step("test", "Run tests");
const tests_run = b.addRunArtifact(tests);
test_step.dependOn(&tests_run.step);
}