Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macOS: depend on bundled headers even for native #7034

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/Compilation.zig
Original file line number Diff line number Diff line change
Expand Up @@ -2147,9 +2147,7 @@ fn detectLibCIncludeDirs(
return detectLibCFromLibCInstallation(arena, target, lci);
}

if (target_util.canBuildLibC(target)) outer: {
if (is_native_os and target.isDarwin()) break :outer; // If we're on Darwin, we want to use native since we only have headers.

if (target_util.canBuildLibC(target)) {
const generic_name = target_util.libCGenericName(target);
// Some architectures are handled by the same set of headers.
const arch_name = if (target.abi.isMusl()) target_util.archMuslName(target.cpu.arch) else @tagName(target.cpu.arch);
Expand Down
7 changes: 5 additions & 2 deletions src/target.zig
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,11 @@ pub const available_libcs = [_]ArchOsAbi{
};

pub fn libCGenericName(target: std.Target) [:0]const u8 {
if (target.os.tag == .windows)
return "mingw";
switch (target.os.tag) {
.windows => return "mingw",
.macos, .ios, .tvos, .watchos => return "darwin",
else => {},
}
switch (target.abi) {
.gnu,
.gnuabin32,
Expand Down