From a5fa6aefc3250182007aa5afa45cd6b8437f88df Mon Sep 17 00:00:00 2001 From: Fabio Arnold Date: Tue, 23 Apr 2024 17:58:39 +0200 Subject: [PATCH] Build watcher on macOS (#26) Link missing frameworks CoreFoundation and CoreServices --- build.zig | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/build.zig b/build.zig index b1a8534..fcb143f 100644 --- a/build.zig +++ b/build.zig @@ -148,15 +148,21 @@ pub fn add_cart( lib.root_module.addImport("wasm4", d.module("wasm4")); + const host_target = b.resolveTargetQuery(.{}); const watch = d.builder.addExecutable(.{ .name = "watch", .root_source_file = .{ .path = "src/watch/main.zig" }, - .target = b.resolveTargetQuery(.{}), + .target = host_target, .optimize = options.optimize, }); watch.root_module.addImport("ws", d.builder.dependency("ws", .{}).module("websocket")); watch.root_module.addImport("mime", d.builder.dependency("mime", .{}).module("mime")); + if (host_target.result.os.tag == .macos) { + watch.linkFramework("CoreFoundation"); + watch.linkFramework("CoreServices"); + } + const watch_run_cmd = b.addRunArtifact(watch); watch_run_cmd.step.dependOn(b.getInstallStep());