mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-25 05:06:24 +03:00
build: use caching for Libtool and Lipo steps
This commit is contained in:
@ -46,26 +46,20 @@ pub fn create(builder: *std.Build, opts: Options) *LibtoolStep {
|
|||||||
fn make(step: *Step) !void {
|
fn make(step: *Step) !void {
|
||||||
const self = @fieldParentPtr(LibtoolStep, "step", step);
|
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.
|
// We use a RunStep here to ease our configuration.
|
||||||
{
|
const run = std.build.RunStep.create(self.builder, self.builder.fmt(
|
||||||
const run = std.build.RunStep.create(self.builder, self.builder.fmt(
|
"libtool {s}",
|
||||||
"libtool {s}",
|
.{self.name},
|
||||||
.{self.name},
|
));
|
||||||
));
|
run.addArgs(&.{
|
||||||
run.condition = .always;
|
"libtool",
|
||||||
run.addArgs(&.{ "libtool", "-static", "-o", output_path });
|
"-static",
|
||||||
for (self.sources) |source| {
|
"-o",
|
||||||
run.addArg(source.getPath(self.builder));
|
});
|
||||||
}
|
try run.argv.append(.{ .output = .{
|
||||||
try run.step.make();
|
.generated_file = &self.out_path,
|
||||||
}
|
.basename = self.out_name,
|
||||||
|
} });
|
||||||
self.out_path.path = output_path;
|
for (self.sources) |source| run.addFileSourceArg(source);
|
||||||
|
try run.step.make();
|
||||||
}
|
}
|
||||||
|
@ -48,30 +48,17 @@ pub fn create(builder: *std.build.Builder, opts: Options) *LipoStep {
|
|||||||
fn make(step: *Step) !void {
|
fn make(step: *Step) !void {
|
||||||
const self = @fieldParentPtr(LipoStep, "step", step);
|
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.
|
// We use a RunStep here to ease our configuration.
|
||||||
{
|
const run = std.build.RunStep.create(self.builder, self.builder.fmt(
|
||||||
const run = std.build.RunStep.create(self.builder, self.builder.fmt(
|
"lipo {s}",
|
||||||
"lipo {s}",
|
.{self.name},
|
||||||
.{self.name},
|
));
|
||||||
));
|
run.addArgs(&.{ "lipo", "-create", "-output" });
|
||||||
run.condition = .always;
|
try run.argv.append(.{ .output = .{
|
||||||
run.addArgs(&.{
|
.generated_file = &self.out_path,
|
||||||
"lipo",
|
.basename = self.out_name,
|
||||||
"-create",
|
} });
|
||||||
"-output",
|
run.addFileSourceArg(self.input_a);
|
||||||
output_path,
|
run.addFileSourceArg(self.input_b);
|
||||||
self.input_a.getPath(self.builder),
|
try run.step.make();
|
||||||
self.input_b.getPath(self.builder),
|
|
||||||
});
|
|
||||||
try run.step.make();
|
|
||||||
}
|
|
||||||
|
|
||||||
self.out_path.path = output_path;
|
|
||||||
}
|
}
|
||||||
|
@ -69,12 +69,13 @@ fn make(step: *Step) !void {
|
|||||||
.{self.name},
|
.{self.name},
|
||||||
));
|
));
|
||||||
run.condition = .always;
|
run.condition = .always;
|
||||||
run.addArgs(&.{
|
run.addArgs(&.{ "xcodebuild", "-create-xcframework" });
|
||||||
"xcodebuild", "-create-xcframework",
|
run.addArg("-library");
|
||||||
"-library", self.library.getPath(self.builder),
|
run.addFileSourceArg(self.library);
|
||||||
"-headers", self.headers.getPath(self.builder),
|
run.addArg("-headers");
|
||||||
"-output", output_path,
|
run.addFileSourceArg(self.headers);
|
||||||
});
|
run.addArg("-output");
|
||||||
|
run.addArg(output_path);
|
||||||
try run.step.make();
|
try run.step.make();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user