build: fix libghostty shared lib install for Windows

On Windows, install as ghostty.dll + ghostty-static.lib instead of
libghostty.so + libghostty.a, following Windows naming conventions.
Guard ubsan_rt bundling in initStatic for MSVC compatibility.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Alessandro De Blasis
2026-03-25 06:21:15 +01:00
parent 26ba9bf579
commit c5bb97bcbd
2 changed files with 13 additions and 2 deletions

View File

@@ -152,8 +152,13 @@ pub fn build(b: *std.Build) !void {
// build on macOS this way ironically so we need to fix that.
if (!config.target.result.os.tag.isDarwin()) {
lib_shared.installHeader(); // Only need one header
lib_shared.install("libghostty.so");
lib_static.install("libghostty.a");
if (config.target.result.os.tag == .windows) {
lib_shared.install("ghostty.dll");
lib_static.install("ghostty-static.lib");
} else {
lib_shared.install("libghostty.so");
lib_static.install("libghostty.a");
}
}
}