diff options
| author | Jacob Young <jacobly0@users.noreply.github.com> | 2024-05-04 15:12:24 -0400 |
|---|---|---|
| committer | Jacob Young <jacobly0@users.noreply.github.com> | 2024-05-05 15:58:08 -0400 |
| commit | dee9f82f69db0d034251b844e0bc4083a1b25fdd (patch) | |
| tree | 14adb7ca55844ef04872501174cd006812edbf43 /lib/std/Build/Step/Compile.zig | |
| parent | e3424332d3fa1264e1f6861b76bb0d1b2996728d (diff) | |
| download | zig-dee9f82f69db0d034251b844e0bc4083a1b25fdd.tar.gz zig-dee9f82f69db0d034251b844e0bc4083a1b25fdd.zip | |
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.
Diffstat (limited to 'lib/std/Build/Step/Compile.zig')
| -rw-r--r-- | lib/std/Build/Step/Compile.zig | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/std/Build/Step/Compile.zig b/lib/std/Build/Step/Compile.zig index d8f2c73311..f660ef64a6 100644 --- a/lib/std/Build/Step/Compile.zig +++ b/lib/std/Build/Step/Compile.zig @@ -806,14 +806,12 @@ pub fn setLibCFile(compile: *Compile, libc_file: ?LazyPath) void { } fn getEmittedFileGeneric(compile: *Compile, output_file: *?*GeneratedFile) LazyPath { - if (output_file.*) |g| { - return .{ .generated = g }; - } + if (output_file.*) |file| return .{ .generated = .{ .file = file } }; const arena = compile.step.owner.allocator; const generated_file = arena.create(GeneratedFile) catch @panic("OOM"); generated_file.* = .{ .step = &compile.step }; output_file.* = generated_file; - return .{ .generated = generated_file }; + return .{ .generated = .{ .file = generated_file } }; } /// Returns the path to the directory that contains the emitted binary file. |
