authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-11-08 17:50:19-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-11-08 18:51:12-07:00
log4d67c3d8878b99fc7b5912dafc50c9a5c01ba169
treefd279882a4a9eceef0bb81f1f52a2a037fd6f59a
parent4236518e3a53b510f8beb5ca67ec1baebcd07158

macOS: depend on bundled headers even for native

This is an alternate fix for #6773. Reverts 872bc787b56f71e53c80f4681523bc8356915b71.

2 files changed, 6 insertions(+), 5 deletions(-)

src/Compilation.zig+1-3
......@@ -2147,9 +2147,7 @@ fn detectLibCIncludeDirs(
21472147 return detectLibCFromLibCInstallation(arena, target, lci);
21482148 }
21492149
2150 if (target_util.canBuildLibC(target)) outer: {
2151 if (is_native_os and target.isDarwin()) break :outer; // If we're on Darwin, we want to use native since we only have headers.
2152
2150 if (target_util.canBuildLibC(target)) {
21532151 const generic_name = target_util.libCGenericName(target);
21542152 // Some architectures are handled by the same set of headers.
21552153 const arch_name = if (target.abi.isMusl()) target_util.archMuslName(target.cpu.arch) else @tagName(target.cpu.arch);
src/target.zig+5-2
......@@ -58,8 +58,11 @@ pub const available_libcs = [_]ArchOsAbi{
5858};
5959
6060pub fn libCGenericName(target: std.Target) [:0]const u8 {
61 if (target.os.tag == .windows)
62 return "mingw";
61 switch (target.os.tag) {
62 .windows => return "mingw",
63 .macos, .ios, .tvos, .watchos => return "darwin",
64 else => {},
65 }
6366 switch (target.abi) {
6467 .gnu,
6568 .gnuabin32,