Skip to content

Commit

Permalink
Merge pull request #20580 from ziglang/watch
Browse files Browse the repository at this point in the history
introduce file system watching features to the zig build system
  • Loading branch information
andrewrk authored Jul 12, 2024
2 parents 0d79aa0 + 5efcc2e commit 1d20ff1
Show file tree
Hide file tree
Showing 27 changed files with 1,552 additions and 417 deletions.
11 changes: 5 additions & 6 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ fn addWasiUpdateStep(b: *std.Build, version: [:0]const u8) !void {
run_opt.addArg("-o");
run_opt.addFileArg(b.path("stage1/zig1.wasm"));

const copy_zig_h = b.addWriteFiles();
const copy_zig_h = b.addUpdateSourceFiles();
copy_zig_h.addCopyFileToSource(b.path("lib/zig.h"), "stage1/zig.h");

const update_zig1_step = b.step("update-zig1", "Update stage1/zig1.wasm");
Expand Down Expand Up @@ -1261,7 +1261,9 @@ fn generateLangRef(b: *std.Build) std.Build.LazyPath {
});

var dir = b.build_root.handle.openDir("doc/langref", .{ .iterate = true }) catch |err| {
std.debug.panic("unable to open 'doc/langref' directory: {s}", .{@errorName(err)});
std.debug.panic("unable to open '{}doc/langref' directory: {s}", .{
b.build_root, @errorName(err),
});
};
defer dir.close();

Expand All @@ -1280,10 +1282,7 @@ fn generateLangRef(b: *std.Build) std.Build.LazyPath {
// in a temporary directory
"--cache-root", b.cache_root.path orelse ".",
});
if (b.zig_lib_dir) |p| {
cmd.addArg("--zig-lib-dir");
cmd.addDirectoryArg(p);
}
cmd.addArgs(&.{ "--zig-lib-dir", b.fmt("{}", .{b.graph.zig_lib_directory}) });
cmd.addArgs(&.{"-i"});
cmd.addFileArg(b.path(b.fmt("doc/langref/{s}", .{entry.name})));

Expand Down
Loading

0 comments on commit 1d20ff1

Please sign in to comment.