diff options
Diffstat (limited to 'build.zig')
| -rw-r--r-- | build.zig | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -156,6 +156,7 @@ pub fn build(b: *std.Build) void { const is_linux = target.result.os.tag == .linux; const want_9proc = b.option(bool, "9proc", "Build the 9proc library module and demo (default: target is Linux)") orelse is_linux; const want_9ns = b.option(bool, "9ns", "Build the 9ns FUSE mount CLI (default: target is Linux; Linux only)") orelse is_linux; + const want_9harness = b.option(bool, "9harness", "Build the harness fs daemon (default: target is Linux; Linux only)") orelse is_linux; if (want_9ns and !is_linux) { std.debug.print("error: -D9ns=true needs a Linux target (got {s})\n", .{@tagName(target.result.os.tag)}); std.process.exit(1); @@ -206,6 +207,25 @@ pub fn build(b: *std.Build) void { programs_itest.dependOn(p.itest_step); } + // The harness fs daemon: a read-only 9P view of every harness's + // state, posted by default as `harness` (Linux only: it posts into + // $XDG_RUNTIME_DIR/9p through cloud9.post). + if (want_9harness and !is_linux) { + std.debug.print("error: -D9harness=true needs a Linux target (got {s})\n", .{@tagName(target.result.os.tag)}); + std.process.exit(1); + } + const harness_build = @import("9harness/build.zig"); + const harness: ?harness_build.Artifacts = if (want_9harness) harness_build.add(b, .{ + .target = target, + .optimize = optimize, + .cloud9 = module, + .ns = if (ns) |p| p.exe else null, + }) else null; + if (harness) |p| { + programs_test.dependOn(p.test_step); + programs_itest.dependOn(p.itest_step); + } + // 9proc's end-to-end suites drive the demo through a 9ns mount, // so they are wired once both fragments have run. if (proc) |i| { |
