build system: add --watch flag and report source file in InstallFile

This direction is not quite right because it mutates shared state in a
threaded context, so the next commit will need to fix this.
This commit is contained in:
Andrew Kelley
2024-07-05 12:24:32 -07:00
parent d2bec8f92f
commit 6e025fc2e2
4 changed files with 147 additions and 21 deletions

View File

@@ -40,6 +40,7 @@ fn make(step: *Step, prog_node: std.Progress.Node) !void {
_ = prog_node;
const b = step.owner;
const install_file: *InstallFile = @fieldParentPtr("step", step);
step.addWatchInput(install_file.source);
const full_src_path = install_file.source.getPath2(b, step);
const full_dest_path = b.getInstallPath(install_file.dir, install_file.dest_rel_path);
const cwd = std.fs.cwd();