feat: add support for a background read thread in linux too

This commit is contained in:
CJ van den Berg 2026-03-08 09:49:03 +01:00
parent 1cbbdbd3cb
commit 5502f8940a
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9
4 changed files with 87 additions and 20 deletions

View file

@ -12,8 +12,17 @@ pub fn build(b: *std.Build) void {
) orelse false;
} else false;
const linux_read_thread = if (target.result.os.tag == .linux) blk: {
break :blk b.option(
bool,
"linux_read_thread",
"Use a background thread on Linux (like macOS/Windows) instead of requiring the caller to drive the event loop via poll_fd/handle_read_ready",
) orelse false;
} else false;
const options = b.addOptions();
options.addOption(bool, "use_fsevents", use_fsevents);
options.addOption(bool, "linux_read_thread", linux_read_thread);
const options_mod = options.createModule();
const mod = b.addModule("nightwatch", .{