| ... | ... | @@ -11,14 +11,14 @@ const Configuration = std.Build.Configuration; |
| 11 | 11 | |
| 12 | 12 | step: Step, |
| 13 | 13 | generated_file: Configuration.GeneratedFileIndex, |
| 14 | | contents: std.ArrayList(u8), |
| 15 | | args: std.ArrayList(Arg), |
| 14 | contents: std.ArrayList(u8) = .empty, |
| 15 | args: std.ArrayList(Arg) = .empty, |
| 16 | 16 | encountered_types: std.StringHashMapUnmanaged(void), |
| 17 | 17 | |
| 18 | 18 | pub const base_tag: Step.Tag = .options; |
| 19 | 19 | |
| 20 | 20 | pub const Arg = struct { |
| 21 | | name: []const u8, |
| 21 | name: Configuration.String, |
| 22 | 22 | path: LazyPath, |
| 23 | 23 | }; |
| 24 | 24 | |
| ... | ... | @@ -34,8 +34,6 @@ pub fn create(owner: *std.Build) *Options { |
| 34 | 34 | .owner = owner, |
| 35 | 35 | }), |
| 36 | 36 | .generated_file = graph.addGeneratedFile(&options.step), |
| 37 | | .contents = .empty, |
| 38 | | .args = .empty, |
| 39 | 37 | .encountered_types = .empty, |
| 40 | 38 | }; |
| 41 | 39 | |
| ... | ... | @@ -416,16 +414,14 @@ fn printStructValue( |
| 416 | 414 | } |
| 417 | 415 | } |
| 418 | 416 | |
| 419 | | /// The value is the path in the cache dir. |
| 420 | | /// Adds a dependency automatically. |
| 421 | | pub fn addOptionPath( |
| 422 | | options: *Options, |
| 423 | | name: []const u8, |
| 424 | | path: LazyPath, |
| 425 | | ) void { |
| 426 | | const arena = options.step.owner.allocator; |
| 417 | /// The added option has type `[]const u8` and value of the provided path. |
| 418 | pub fn addOptionPath(options: *Options, name: []const u8, path: LazyPath) void { |
| 419 | const graph = options.step.owner.graph; |
| 420 | const arena = graph.arena; |
| 421 | const wc = &graph.wip_configuration; |
| 422 | |
| 427 | 423 | options.args.append(arena, .{ |
| 428 | | .name = options.step.owner.dupe(name), |
| 424 | .name = try wc.addString(name), |
| 429 | 425 | .path = path.dupe(options.step.owner), |
| 430 | 426 | }) catch @panic("OOM"); |
| 431 | 427 | path.addStepDependencies(&options.step); |