mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-07-31 04:39:01 +00:00
build: fix static libghostty-vt linking on Windows
This PR fixes static linking for libghostty-vt on Windows by propagating a couple of missing dependencies (discovered while running Neovim's Zig build, see https://github.com/neovim/neovim/actions/runs/30130848061/job/89604799965?pr=39773).
This commit is contained in:
committed by
Mitchell Hashimoto
parent
40ab02e338
commit
1fe1b2d23c
4
.github/workflows/test.yml
vendored
4
.github/workflows/test.yml
vendored
@@ -742,6 +742,10 @@ jobs:
|
||||
- name: Build libghostty-vt
|
||||
run: zig build -Demit-lib-vt
|
||||
|
||||
- name: Test static linking
|
||||
working-directory: example/c-vt-static
|
||||
run: zig build
|
||||
|
||||
build-libghostty-windows-gnu:
|
||||
runs-on: namespace-profile-ghostty-windows
|
||||
timeout-minutes: 45
|
||||
|
||||
@@ -14,6 +14,7 @@ pub fn build(b: *std.Build) void {
|
||||
.root = b.path("src"),
|
||||
.files = &.{"main.c"},
|
||||
});
|
||||
exe_mod.addCMacro("GHOSTTY_STATIC", "");
|
||||
|
||||
// You'll want to use a lazy dependency here so that ghostty is only
|
||||
// downloaded if you actually need it.
|
||||
|
||||
@@ -247,6 +247,14 @@ fn initLib(
|
||||
// Zig's ubsan emits /exclude-symbols linker directives that
|
||||
// are incompatible with the MSVC linker (LNK4229).
|
||||
lib.bundle_ubsan_rt = false;
|
||||
|
||||
if (kind == .static) {
|
||||
// compiler_rt expects ntdll to provide _fltused when libc is
|
||||
// linked, and the Zig standard library uses other NT and kernel32
|
||||
// symbols.
|
||||
lib.root_module.linkSystemLibrary("ntdll", .{});
|
||||
lib.root_module.linkSystemLibrary("kernel32", .{});
|
||||
}
|
||||
}
|
||||
|
||||
if (lib.rootModuleTarget().abi.isAndroid()) {
|
||||
|
||||
Reference in New Issue
Block a user