aboutsummaryrefslogtreecommitdiff
path: root/vendor/libghostty-vt/src/build/LipoStep.zig
diff options
context:
space:
mode:
authorCan Celik <ogulcancelik@gmail.com>2026-04-04 19:22:04 +0300
committerCan Celik <ogulcancelik@gmail.com>2026-04-05 01:23:06 +0300
commit41dd733ca7123c9ac4bfc6c781697a660e95b052 (patch)
tree3fc91815ca139ef2e0b281bba0abda4ef15175f4 /vendor/libghostty-vt/src/build/LipoStep.zig
parent55c138263e190a1e79d4b997bfb9397306c0ec1f (diff)
feat: finish ghostty pane backend integration
Diffstat (limited to 'vendor/libghostty-vt/src/build/LipoStep.zig')
-rw-r--r--vendor/libghostty-vt/src/build/LipoStep.zig42
1 files changed, 42 insertions, 0 deletions
diff --git a/vendor/libghostty-vt/src/build/LipoStep.zig b/vendor/libghostty-vt/src/build/LipoStep.zig
new file mode 100644
index 00000000..c9c1530e
--- /dev/null
+++ b/vendor/libghostty-vt/src/build/LipoStep.zig
@@ -0,0 +1,42 @@
+//! A zig builder step that runs "lipo" on two binaries to create
+//! a universal binary.
+const LipoStep = @This();
+
+const std = @import("std");
+const Step = std.Build.Step;
+const RunStep = std.Build.Step.Run;
+const LazyPath = std.Build.LazyPath;
+
+pub const Options = struct {
+ /// The name of the xcframework to create.
+ name: []const u8,
+
+ /// The filename (not the path) of the file to create.
+ out_name: []const u8,
+
+ /// Library file (dylib, a) to package.
+ input_a: LazyPath,
+ input_b: LazyPath,
+};
+
+step: *Step,
+
+/// Resulting binary
+output: LazyPath,
+
+pub fn create(b: *std.Build, opts: Options) *LipoStep {
+ const self = b.allocator.create(LipoStep) catch @panic("OOM");
+
+ const run_step = RunStep.create(b, b.fmt("lipo {s}", .{opts.name}));
+ run_step.addArgs(&.{ "lipo", "-create", "-output" });
+ const output = run_step.addOutputFileArg(opts.out_name);
+ run_step.addFileArg(opts.input_a);
+ run_step.addFileArg(opts.input_b);
+
+ self.* = .{
+ .step = &run_step.step,
+ .output = output,
+ };
+
+ return self;
+}