From ed043cb78530f5f1271ead8e33cc6fbc43b027e5 Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Sat, 29 Nov 2025 12:32:23 +0100 Subject: [PATCH] build: add zine file watcher to build --- build.zig | 5 +++++ src/watcher/root.zig | 8 ++++++++ 2 files changed, 13 insertions(+) create mode 100644 src/watcher/root.zig diff --git a/build.zig b/build.zig index dbe08cb..d5891eb 100644 --- a/build.zig +++ b/build.zig @@ -339,6 +339,10 @@ pub fn build_exe( }); const syntax_mod = syntax_dep.module("syntax"); + const watcher_mod = b.createModule(.{ + .root_source_file = b.path("src/watcher/root.zig"), + }); + const help_mod = b.createModule(.{ .root_source_file = b.path("help.md"), }); @@ -421,6 +425,7 @@ pub fn build_exe( .{ .name = "thespian", .module = thespian_mod }, .{ .name = "vaxis", .module = vaxis_mod }, .{ .name = "file_type_config", .module = file_type_config_mod }, + .{ .name = "watcher", .module = watcher_mod }, }, }); diff --git a/src/watcher/root.zig b/src/watcher/root.zig new file mode 100644 index 0000000..82b2ff3 --- /dev/null +++ b/src/watcher/root.zig @@ -0,0 +1,8 @@ +const builtin = @import("builtin"); + +pub const Watcher = switch (builtin.target.os.tag) { + .linux => @import("serve/watcher/LinuxWatcher.zig"), + .macos => @import("serve/watcher/MacosWatcher.zig"), + .windows => @import("serve/watcher/WindowsWatcher.zig"), + else => @compileError("unsupported platform"), +};