build: install the ghostty-vt artifact

pull/8895/head
Mitchell Hashimoto 2025-09-24 09:59:57 -07:00
parent e1429dabae
commit de013148d3
No known key found for this signature in database
GPG Key ID: 523D5DC389D273BC
2 changed files with 11 additions and 25 deletions

View File

@ -102,8 +102,8 @@ pub fn build(b: *std.Build) !void {
b,
&mod,
);
libghostty_vt_shared.install(libvt_step, "libghostty-vt");
libghostty_vt_shared.installHeader(libvt_step);
libghostty_vt_shared.install(libvt_step);
libghostty_vt_shared.install(b.getInstallStep());
// Helpgen
if (config.emit_helpgen) deps.help_strings.install();

View File

@ -11,13 +11,13 @@ const LipoStep = @import("LipoStep.zig");
/// The step that generates the file.
step: *std.Build.Step,
/// The artifact result
artifact: *std.Build.Step.InstallArtifact,
/// The final library file
output: std.Build.LazyPath,
dsym: ?std.Build.LazyPath,
/// Library extension, e.g. "dylib", "so", "dll"
ext: []const u8,
pub fn initShared(
b: *std.Build,
zig: *const GhosttyZig,
@ -27,6 +27,10 @@ pub fn initShared(
.name = "ghostty-vt",
.root_module = zig.vt,
});
lib.installHeader(
b.path("include/ghostty-vt.h"),
"ghostty-vt.h",
);
// Get our debug symbols
const dsymutil: ?std.Build.LazyPath = dsymutil: {
@ -44,33 +48,15 @@ pub fn initShared(
return .{
.step = &lib.step,
.artifact = b.addInstallArtifact(lib, .{}),
.output = lib.getEmittedBin(),
.dsym = dsymutil,
.ext = Config.sharedLibExt(target),
};
}
pub fn install(
self: *const GhosttyLibVt,
step: *std.Build.Step,
name: []const u8,
) void {
const b = self.step.owner;
const lib_install = b.addInstallLibFile(
self.output,
b.fmt("{s}.{s}", .{ name, self.ext }),
);
step.dependOn(&lib_install.step);
}
pub fn installHeader(
self: *const GhosttyLibVt,
step: *std.Build.Step,
) void {
const b = self.step.owner;
const header_install = b.addInstallHeaderFile(
b.path("include/ghostty-vt.h"),
"ghostty-vt.h",
);
step.dependOn(&header_install.step);
step.dependOn(&self.artifact.step);
}