Appends an input file to the command line arguments prepended with a string.
For example, a prefix of "-F" will result in the child process seeing something like this: "-Fexample.txt"
The child process will see a single argument, even if the prefix has spaces. Modifications to this file will be detected as a cache miss in subsequent builds, causing the child process to be re-executed.
Related:
addOutputFileArg - for files generated by the child processpub fn addFileArg2(run: *Run, lp: std.Build.LazyPath, options: PathArgOptions) void
pub fn addFileArg2(run: *Run, lp: std.Build.LazyPath, options: PathArgOptions) void {
const graph = run.step.owner.graph;
const arena = graph.arena;
const prefixed_file_source: DecoratedLazyPath = .{
.prefix = graph.dupeString(options.prefix),
.lazy_path = lp.dupe(graph),
.suffix = graph.dupeString(options.suffix),
.make_absolute = options.make_absolute,
};
run.argv.append(arena, .{ .lazy_path = prefixed_file_source }) catch @panic("OOM");
lp.addStepDependencies(&run.step);
}