Function addPrefixedFileArg [src]

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: addFileArg - same thing but without the prefix addOutputFileArg - for files generated by the child process

Prototype

pub fn addPrefixedFileArg(run: *Run, prefix: []const u8, lp: std.Build.LazyPath) void

Parameters

run: *Runprefix: []const u8lp: std.Build.LazyPath

Source

pub fn addPrefixedFileArg(run: *Run, prefix: []const u8, lp: std.Build.LazyPath) void { const b = run.step.owner; const prefixed_file_source: PrefixedLazyPath = .{ .prefix = b.dupe(prefix), .lazy_path = lp.dupe(b), }; run.argv.append(b.allocator, .{ .lazy_path = prefixed_file_source }) catch @panic("OOM"); lp.addStepDependencies(&run.step); }