mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-07-21 16:41:26 +00:00
build: fix oniguruma compilation on Windows with MSVC
Conditionally disable POSIX-only header defines (alloca.h, sys/times.h, sys/time.h, unistd.h) on Windows since they do not exist with MSVC. Enable USE_CRNL_AS_LINE_TERMINATOR on Windows for correct line endings. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -68,6 +68,7 @@ fn buildLib(b: *std.Build, module: *std.Build.Module, options: anytype) !*std.Bu
|
||||
.linkage = .static,
|
||||
});
|
||||
const t = target.result;
|
||||
const is_windows = t.os.tag == .windows;
|
||||
lib.linkLibC();
|
||||
|
||||
if (target.result.os.tag.isDarwin()) {
|
||||
@@ -86,13 +87,13 @@ fn buildLib(b: *std.Build, module: *std.Build.Module, options: anytype) !*std.Bu
|
||||
.PACKAGE_VERSION = "6.9.9",
|
||||
.VERSION = "6.9.9",
|
||||
.HAVE_ALLOCA = true,
|
||||
.HAVE_ALLOCA_H = true,
|
||||
.USE_CRNL_AS_LINE_TERMINATOR = false,
|
||||
.HAVE_ALLOCA_H = !is_windows,
|
||||
.USE_CRNL_AS_LINE_TERMINATOR = is_windows,
|
||||
.HAVE_STDINT_H = true,
|
||||
.HAVE_SYS_TIMES_H = true,
|
||||
.HAVE_SYS_TIME_H = true,
|
||||
.HAVE_SYS_TIMES_H = !is_windows,
|
||||
.HAVE_SYS_TIME_H = !is_windows,
|
||||
.HAVE_SYS_TYPES_H = true,
|
||||
.HAVE_UNISTD_H = true,
|
||||
.HAVE_UNISTD_H = !is_windows,
|
||||
.HAVE_INTTYPES_H = true,
|
||||
.SIZEOF_INT = t.cTypeByteSize(.int),
|
||||
.SIZEOF_LONG = t.cTypeByteSize(.long),
|
||||
|
||||
Reference in New Issue
Block a user