aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJakub Konka <kubkon@jakubkonka.com>2021-11-25 12:08:16 +0100
committerJakub Konka <kubkon@jakubkonka.com>2021-11-25 12:19:16 +0100
commit4270f234db02d40da1507fe5cb20029aa320ee42 (patch)
tree9cd18be46b77fdfb97a53500130c6e19815a4d07 /src
parent1954cdc1066f2d59961e4cdd24a9d80fd6eb86c3 (diff)
downloadzig-4270f234db02d40da1507fe5cb20029aa320ee42.tar.gz
zig-4270f234db02d40da1507fe5cb20029aa320ee42.zip
Skip detecting native libc dirs on darwin
This is handled before by detecting and adding SDK path which is a centralised point for the native libc installation on darwin.
Diffstat (limited to 'src')
-rw-r--r--src/Compilation.zig7
-rw-r--r--src/libc_installation.zig4
2 files changed, 10 insertions, 1 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig
index 20d67e7c77..9da855789f 100644
--- a/src/Compilation.zig
+++ b/src/Compilation.zig
@@ -3792,6 +3792,13 @@ fn detectLibCIncludeDirs(
// If linking system libraries and targeting the native abi, default to
// using the system libc installation.
if (link_system_libs and is_native_abi and !target.isMinGW()) {
+ if (target.isDarwin()) {
+ // For Darwin/macOS, we are all set with getSDKPath found earlier.
+ return LibCDirs{
+ .libc_include_dir_list = &[0][]u8{},
+ .libc_installation = null,
+ };
+ }
const libc = try arena.create(LibCInstallation);
libc.* = try LibCInstallation.findNative(.{ .allocator = arena, .verbose = true });
return detectLibCFromLibCInstallation(arena, target, libc);
diff --git a/src/libc_installation.zig b/src/libc_installation.zig
index 3567f2e22f..615f9436e6 100644
--- a/src/libc_installation.zig
+++ b/src/libc_installation.zig
@@ -185,7 +185,9 @@ pub const LibCInstallation = struct {
pub fn findNative(args: FindNativeOptions) FindError!LibCInstallation {
var self: LibCInstallation = .{};
- if (is_windows) {
+ if (is_darwin) {
+ @panic("Darwin is handled separately via std.zig.system.darwin module");
+ } else if (is_windows) {
if (!build_options.have_llvm)
return error.WindowsSdkNotFound;
var sdk: *ZigWindowsSDK = undefined;