diff --git a/build.zig b/build.zig index 9e7b401..0edd98e 100644 --- a/build.zig +++ b/build.zig @@ -4,10 +4,10 @@ pub fn build(b: *std.Build) void { const target = b.standardTargetOptions(.{}); const optimize = b.standardOptimizeOption(.{}); - const use_fsevents = if (target.result.os.tag == .macos) blk: { + const macos_fsevents = if (target.result.os.tag == .macos) blk: { break :blk b.option( bool, - "use_fsevents", + "macos_fsevents", "Use the FSEvents backend on macOS instead of kqueue (requires Xcode frameworks)", ) orelse false; } else false; @@ -19,7 +19,7 @@ pub fn build(b: *std.Build) void { ) orelse true; const options = b.addOptions(); - options.addOption(bool, "use_fsevents", use_fsevents); + options.addOption(bool, "macos_fsevents", macos_fsevents); options.addOption(bool, "linux_read_thread", linux_read_thread); const options_mod = options.createModule(); @@ -32,7 +32,7 @@ pub fn build(b: *std.Build) void { }, }); - if (use_fsevents) { + if (macos_fsevents) { const xcode_frameworks = b.lazyDependency("xcode-frameworks", .{}) orelse return; mod.addSystemFrameworkPath(xcode_frameworks.path("Frameworks")); mod.addLibraryPath(xcode_frameworks.path("lib")); diff --git a/src/nightwatch.zig b/src/nightwatch.zig index 8a2a7f3..fe6817e 100644 --- a/src/nightwatch.zig +++ b/src/nightwatch.zig @@ -174,7 +174,7 @@ fn recurse_watch(backend: *Backend, allocator: std.mem.Allocator, dir_path: []co const Backend = switch (builtin.os.tag) { .linux => INotifyBackend, - .macos => if (build_options.use_fsevents) FSEventsBackend else KQueueBackend, + .macos => if (build_options.macos_fsevents) FSEventsBackend else KQueueBackend, .freebsd => KQueueBackend, .windows => WindowsBackend, else => @compileError("file_watcher: unsupported OS"),