Run: add output directory arguments
This allows running commands that take an output directory argument. The main thing that was needed for this feature was generated file subpaths, to allow access to the files in a generated directory. Additionally, a minor change was required to so that the correct directory is created for output directory args.
This commit is contained in:
@@ -59,8 +59,7 @@ pub fn create(owner: *std.Build, options: Options) *ConfigHeader {
|
||||
if (options.style.getPath()) |s| default_include_path: {
|
||||
const sub_path = switch (s) {
|
||||
.src_path => |sp| sp.sub_path,
|
||||
.path => |path| path,
|
||||
.generated, .generated_dirname => break :default_include_path,
|
||||
.generated => break :default_include_path,
|
||||
.cwd_relative => |sub_path| sub_path,
|
||||
.dependency => |dependency| dependency.sub_path,
|
||||
};
|
||||
@@ -106,7 +105,7 @@ pub fn addValues(config_header: *ConfigHeader, values: anytype) void {
|
||||
}
|
||||
|
||||
pub fn getOutput(config_header: *ConfigHeader) std.Build.LazyPath {
|
||||
return .{ .generated = &config_header.output_file };
|
||||
return .{ .generated = .{ .file = &config_header.output_file } };
|
||||
}
|
||||
|
||||
fn addValuesInner(config_header: *ConfigHeader, values: anytype) !void {
|
||||
|
||||
Reference in New Issue
Block a user