mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-04-06 07:38:21 +00:00
build: fix freetype compilation on Windows with MSVC
Gate HAVE_UNISTD_H and HAVE_FCNTL_H behind a non-Windows check since these headers do not exist with MSVC. Freetype includes zlib headers which conditionally include unistd.h based on this define. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -84,11 +84,14 @@ fn buildLib(b: *std.Build, module: *std.Build.Module, options: anytype) !*std.Bu
|
||||
|
||||
"-DFT_CONFIG_OPTION_SYSTEM_ZLIB=1",
|
||||
|
||||
"-DHAVE_UNISTD_H",
|
||||
"-DHAVE_FCNTL_H",
|
||||
|
||||
"-fno-sanitize=undefined",
|
||||
});
|
||||
if (target.result.os.tag != .windows) {
|
||||
try flags.appendSlice(b.allocator, &.{
|
||||
"-DHAVE_UNISTD_H",
|
||||
"-DHAVE_FCNTL_H",
|
||||
});
|
||||
}
|
||||
|
||||
if (target.result.os.tag == .freebsd or target.result.abi == .musl) {
|
||||
try flags.append(b.allocator, "-fPIC");
|
||||
|
||||
Reference in New Issue
Block a user