diff --git a/src/build/LibtoolStep.zig b/src/build/LibtoolStep.zig index 09e5e7386..1d114f097 100644 --- a/src/build/LibtoolStep.zig +++ b/src/build/LibtoolStep.zig @@ -46,26 +46,20 @@ pub fn create(builder: *std.Build, opts: Options) *LibtoolStep { fn make(step: *Step) !void { const self = @fieldParentPtr(LibtoolStep, "step", step); - // TODO: use the zig cache system when it is in the stdlib - // https://github.com/ziglang/zig/pull/14571 - const output_path = try self.builder.cache_root.join( - self.builder.allocator, - &.{self.out_name}, - ); - // We use a RunStep here to ease our configuration. - { - const run = std.build.RunStep.create(self.builder, self.builder.fmt( - "libtool {s}", - .{self.name}, - )); - run.condition = .always; - run.addArgs(&.{ "libtool", "-static", "-o", output_path }); - for (self.sources) |source| { - run.addArg(source.getPath(self.builder)); - } - try run.step.make(); - } - - self.out_path.path = output_path; + const run = std.build.RunStep.create(self.builder, self.builder.fmt( + "libtool {s}", + .{self.name}, + )); + run.addArgs(&.{ + "libtool", + "-static", + "-o", + }); + try run.argv.append(.{ .output = .{ + .generated_file = &self.out_path, + .basename = self.out_name, + } }); + for (self.sources) |source| run.addFileSourceArg(source); + try run.step.make(); } diff --git a/src/build/LipoStep.zig b/src/build/LipoStep.zig index 31fc0d5c6..f073ca15f 100644 --- a/src/build/LipoStep.zig +++ b/src/build/LipoStep.zig @@ -48,30 +48,17 @@ pub fn create(builder: *std.build.Builder, opts: Options) *LipoStep { fn make(step: *Step) !void { const self = @fieldParentPtr(LipoStep, "step", step); - // TODO: use the zig cache system when it is in the stdlib - // https://github.com/ziglang/zig/pull/14571 - const output_path = try self.builder.cache_root.join( - self.builder.allocator, - &.{self.out_name}, - ); - // We use a RunStep here to ease our configuration. - { - const run = std.build.RunStep.create(self.builder, self.builder.fmt( - "lipo {s}", - .{self.name}, - )); - run.condition = .always; - run.addArgs(&.{ - "lipo", - "-create", - "-output", - output_path, - self.input_a.getPath(self.builder), - self.input_b.getPath(self.builder), - }); - try run.step.make(); - } - - self.out_path.path = output_path; + const run = std.build.RunStep.create(self.builder, self.builder.fmt( + "lipo {s}", + .{self.name}, + )); + run.addArgs(&.{ "lipo", "-create", "-output" }); + try run.argv.append(.{ .output = .{ + .generated_file = &self.out_path, + .basename = self.out_name, + } }); + run.addFileSourceArg(self.input_a); + run.addFileSourceArg(self.input_b); + try run.step.make(); } diff --git a/src/build/XCFrameworkStep.zig b/src/build/XCFrameworkStep.zig index c48fba4ff..120609bf4 100644 --- a/src/build/XCFrameworkStep.zig +++ b/src/build/XCFrameworkStep.zig @@ -69,12 +69,13 @@ fn make(step: *Step) !void { .{self.name}, )); run.condition = .always; - run.addArgs(&.{ - "xcodebuild", "-create-xcframework", - "-library", self.library.getPath(self.builder), - "-headers", self.headers.getPath(self.builder), - "-output", output_path, - }); + run.addArgs(&.{ "xcodebuild", "-create-xcframework" }); + run.addArg("-library"); + run.addFileSourceArg(self.library); + run.addArg("-headers"); + run.addFileSourceArg(self.headers); + run.addArg("-output"); + run.addArg(output_path); try run.step.make(); } }