aboutsummaryrefslogtreecommitdiff
path: root/build.zig
diff options
context:
space:
mode:
Diffstat (limited to 'build.zig')
-rw-r--r--build.zig10
1 files changed, 9 insertions, 1 deletions
diff --git a/build.zig b/build.zig
index 59c2f26..76e2321 100644
--- a/build.zig
+++ b/build.zig
@@ -29,12 +29,20 @@ pub fn build(b: *std.Build) void {
.language = .objective_c,
.flags = &.{"-fobjc-arc"},
});
- exe.root_module.linkFramework("Cocoa", .{});
tests.root_module.addCSourceFiles(.{
.files = &.{"src/Clip/NSPBBridge.m"},
.language = .objective_c,
.flags = &.{"-fobjc-arc"},
});
+ if (b.sysroot) |sysroot| {
+ const framework_path = b.pathJoin(&.{ sysroot, "System/Library/Frameworks" });
+ const include_path = b.pathJoin(&.{ sysroot, "usr/include" });
+ exe.root_module.addSystemFrameworkPath(.{ .cwd_relative = framework_path });
+ exe.root_module.addSystemIncludePath(.{ .cwd_relative = include_path });
+ tests.root_module.addSystemFrameworkPath(.{ .cwd_relative = framework_path });
+ tests.root_module.addSystemIncludePath(.{ .cwd_relative = include_path });
+ }
+ exe.root_module.linkFramework("Cocoa", .{});
tests.root_module.linkFramework("Cocoa", .{});
}