commit 3268f51d202f31b006928175b5770ed6d23dddbc
parent d4ecfc4234957f80d1a866654cfc308bd98e1bf1
Author: Vlad Panazan <git@praznet.com>
Date: Sun, 4 May 2025 22:15:37 +0200
fix(build): musl libc build.zig
Diffstat:
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/.gitignore b/.gitignore
@@ -10,6 +10,8 @@ compile_commands.json
/.idea/
# Build/deps dir
+/.zig-cache/
+/zig-out/
/.deps/
/tmp/
/.clangd/
diff --git a/build.zig b/build.zig
@@ -182,7 +182,7 @@ pub fn build(b: *std.Build) !void {
.HAVE_FSEEKO = modernUnix,
.HAVE_LANGINFO_H = modernUnix,
.HAVE_NL_LANGINFO_CODESET = modernUnix,
- .HAVE_NL_MSG_CAT_CNTR = isLinux,
+ .HAVE_NL_MSG_CAT_CNTR = t.isGnuLibC(),
.HAVE_PWD_FUNCS = modernUnix,
.HAVE_READLINK = modernUnix,
.HAVE_STRNLEN = modernUnix,
@@ -195,7 +195,7 @@ pub fn build(b: *std.Build) !void {
.HAVE_SYS_UTSNAME_H = modernUnix,
.HAVE_SYS_WAIT_H = false, // unused
.HAVE_TERMIOS_H = modernUnix,
- .HAVE_WORKING_LIBINTL = isLinux,
+ .HAVE_WORKING_LIBINTL = t.isGnuLibC(),
.UNIX = modernUnix,
.CASE_INSENSITIVE_FILENAME = tag.isDarwin() or tag == .windows,
.HAVE_SYS_UIO_H = modernUnix,
@@ -205,7 +205,7 @@ pub fn build(b: *std.Build) !void {
.HAVE_BE64TOH = modernUnix and !tag.isDarwin(),
.ORDER_BIG_ENDIAN = t.cpu.arch.endian() == .big,
.ENDIAN_INCLUDE_FILE = "endian.h",
- .HAVE_EXECINFO_BACKTRACE = modernUnix,
+ .HAVE_EXECINFO_BACKTRACE = modernUnix and !t.isMuslLibC(),
.HAVE_BUILTIN_ADD_OVERFLOW = true,
.HAVE_WIMPLICIT_FALLTHROUGH_FLAG = true,
.HAVE_BITSCANFORWARD64 = null,