@@ -11,13 +11,13 @@ const LipoStep = @import("LipoStep.zig");
1111/// The step that generates the file.
1212step : * std.Build.Step ,
1313
14+ /// The artifact result
15+ artifact : * std.Build.Step.InstallArtifact ,
16+
1417/// The final library file
1518output : std.Build.LazyPath ,
1619dsym : ? std.Build.LazyPath ,
1720
18- /// Library extension, e.g. "dylib", "so", "dll"
19- ext : []const u8 ,
20-
2121pub 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
5357pub 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