authorgravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2026-01-10 12:32:02+01:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-01-10 22:04:00+01:00
logf3db3a087ef5b51880498b5a363c3741743e8020
tree2f0c36f716972ed1d2d7424a7127a16e35cfdfdc
parent707823abdb9754bcd7c89dadc347ba3c4fed113e

std: ignore -fmacro-prefix-map flag when parsing NIX_CFLAGS_COMPILE

Since we ignore this flag in `clang_options_data.zig`, it makes sense to ignore it for Nix as well. One thing I've been thinking about is if it would make sense to somehow use `clang_options_data.zig` as source of truth for handling Nix cflags too rather than slap more hard-coded escape hatches.

1 files changed, 4 insertions(+), 3 deletions(-)

lib/std/zig/system/NativePaths.zig+4-3
......@@ -40,10 +40,11 @@ pub fn detect(
4040 break;
4141 };
4242 try self.addFrameworkDir(framework_path);
43 } else if (mem.startsWith(u8, word, "-frandom-seed=") or
44 mem.startsWith(u8, word, "-fmacro-prefix-map="))
45 {
46 // Ignore this argument.
4347 } else {
44 if (mem.startsWith(u8, word, "-frandom-seed=")) {
45 continue;
46 }
4748 try self.addWarningFmt("Unrecognized C flag from NIX_CFLAGS_COMPILE: {s}", .{word});
4849 }
4950 }