Skip to content

Commit de01314

Browse files
committed
build: install the ghostty-vt artifact
1 parent e1429da commit de01314

File tree

2 files changed

+11
-25
lines changed

2 files changed

+11
-25
lines changed

build.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ pub fn build(b: *std.Build) !void {
102102
b,
103103
&mod,
104104
);
105-
libghostty_vt_shared.install(libvt_step, "libghostty-vt");
106-
libghostty_vt_shared.installHeader(libvt_step);
105+
libghostty_vt_shared.install(libvt_step);
106+
libghostty_vt_shared.install(b.getInstallStep());
107107

108108
// Helpgen
109109
if (config.emit_helpgen) deps.help_strings.install();

src/build/GhosttyLibVt.zig

Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ const LipoStep = @import("LipoStep.zig");
1111
/// The step that generates the file.
1212
step: *std.Build.Step,
1313

14+
/// The artifact result
15+
artifact: *std.Build.Step.InstallArtifact,
16+
1417
/// The final library file
1518
output: std.Build.LazyPath,
1619
dsym: ?std.Build.LazyPath,
1720

18-
/// Library extension, e.g. "dylib", "so", "dll"
19-
ext: []const u8,
20-
2121
pub fn initShared(
2222
b: *std.Build,
2323
zig: *const GhosttyZig,
@@ -27,6 +27,10 @@ pub fn initShared(
2727
.name = "ghostty-vt",
2828
.root_module = zig.vt,
2929
});
30+
lib.installHeader(
31+
b.path("include/ghostty-vt.h"),
32+
"ghostty-vt.h",
33+
);
3034

3135
// Get our debug symbols
3236
const dsymutil: ?std.Build.LazyPath = dsymutil: {
@@ -44,33 +48,15 @@ pub fn initShared(
4448

4549
return .{
4650
.step = &lib.step,
51+
.artifact = b.addInstallArtifact(lib, .{}),
4752
.output = lib.getEmittedBin(),
4853
.dsym = dsymutil,
49-
.ext = Config.sharedLibExt(target),
5054
};
5155
}
5256

5357
pub fn install(
5458
self: *const GhosttyLibVt,
5559
step: *std.Build.Step,
56-
name: []const u8,
57-
) void {
58-
const b = self.step.owner;
59-
const lib_install = b.addInstallLibFile(
60-
self.output,
61-
b.fmt("{s}.{s}", .{ name, self.ext }),
62-
);
63-
step.dependOn(&lib_install.step);
64-
}
65-
66-
pub fn installHeader(
67-
self: *const GhosttyLibVt,
68-
step: *std.Build.Step,
6960
) void {
70-
const b = self.step.owner;
71-
const header_install = b.addInstallHeaderFile(
72-
b.path("include/ghostty-vt.h"),
73-
"ghostty-vt.h",
74-
);
75-
step.dependOn(&header_install.step);
61+
step.dependOn(&self.artifact.step);
7662
}

0 commit comments

Comments
 (0)