diff --git a/build.zig b/build.zig index 8dfec44..198a52b 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"), +};