Skip to content

Commit

Permalink
Build watcher on macOS (#26)
Browse files Browse the repository at this point in the history
Link missing frameworks CoreFoundation and CoreServices
  • Loading branch information
fabioarnold authored Apr 23, 2024
1 parent 421cf77 commit a5fa6ae
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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());

Expand Down

0 comments on commit a5fa6ae

Please sign in to comment.