addPrefixedDepFileOutputArg
Add a prefixed path argument to a dep file (.d) for the child process to write its discovered additional dependencies. Only one dep file argument is allowed by instance.
Function parameters
Parameters
- run:*Run
- prefix:[]const u8
- basename:[]const u8
Type definitions in this namespace
Types
Functions in this namespace
Functions
- addOutputFileArg
- Provides a file path as a command line argument to the command being run.
- addPrefixedOutputFileArg
- Provides a file path as a command line argument to the command being run.
- addFileArg
- Appends an input file to the command line arguments.
- addPrefixedFileArg
- Appends an input file to the command line arguments prepended with a string.
- addOutputDirectoryArg
- Provides a directory path as a command line argument to the command being run.
- addPrefixedOutputDirectoryArg
- Provides a directory path as a command line argument to the command being run.
- addDepFileOutputArg
- Add a path argument to a dep file (.d) for the child process to write its
- addPrefixedDepFileOutputArg
- Add a prefixed path argument to a dep file (.d) for the child process to
- expectStdErrEqual
- Adds a check for exact stderr match.
- expectStdOutEqual
- Adds a check for exact stdout match as well as a check for exit code 0, if
- addFileInput
- Adds an additional input files that, when modified, indicates that this Run
= .run
Values
- base_id
- = .run
Source
Implementation
pub fn addPrefixedDepFileOutputArg(run: *Run, prefix: []const u8, basename: []const u8) std.Build.LazyPath {
const b = run.step.owner;
assert(run.dep_output_file == null);
const dep_file = b.allocator.create(Output) catch @panic("OOM");
dep_file.* = .{
.prefix = b.dupe(prefix),
.basename = b.dupe(basename),
.generated_file = .{ .step = &run.step },
};
run.dep_output_file = dep_file;
run.argv.append(b.allocator, .{ .output_file = dep_file }) catch @panic("OOM");
return .{ .generated = .{ .file = &dep_file.generated_file } };
}