authorgravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2021-11-25 12:08:16+01:00
committergravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2021-11-25 12:19:16+01:00
log4270f234db02d40da1507fe5cb20029aa320ee42
tree9cd18be46b77fdfb97a53500130c6e19815a4d07
parent1954cdc1066f2d59961e4cdd24a9d80fd6eb86c3

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.

2 files changed, 10 insertions(+), 1 deletions(-)

src/Compilation.zig+7
...@@ -3792,6 +3792,13 @@ fn detectLibCIncludeDirs(...@@ -3792,6 +3792,13 @@ fn detectLibCIncludeDirs(
3792 // If linking system libraries and targeting the native abi, default to3792 // If linking system libraries and targeting the native abi, default to
3793 // using the system libc installation.3793 // using the system libc installation.
3794 if (link_system_libs and is_native_abi and !target.isMinGW()) {3794 if (link_system_libs and is_native_abi and !target.isMinGW()) {
3795 if (target.isDarwin()) {
3796 // For Darwin/macOS, we are all set with getSDKPath found earlier.
3797 return LibCDirs{
3798 .libc_include_dir_list = &[0][]u8{},
3799 .libc_installation = null,
3800 };
3801 }
3795 const libc = try arena.create(LibCInstallation);3802 const libc = try arena.create(LibCInstallation);
3796 libc.* = try LibCInstallation.findNative(.{ .allocator = arena, .verbose = true });3803 libc.* = try LibCInstallation.findNative(.{ .allocator = arena, .verbose = true });
3797 return detectLibCFromLibCInstallation(arena, target, libc);3804 return detectLibCFromLibCInstallation(arena, target, libc);
src/libc_installation.zig+3-1
...@@ -185,7 +185,9 @@ pub const LibCInstallation = struct {...@@ -185,7 +185,9 @@ pub const LibCInstallation = struct {
185 pub fn findNative(args: FindNativeOptions) FindError!LibCInstallation {185 pub fn findNative(args: FindNativeOptions) FindError!LibCInstallation {
186 var self: LibCInstallation = .{};186 var self: LibCInstallation = .{};
187187
188 if (is_windows) {188 if (is_darwin) {
189 @panic("Darwin is handled separately via std.zig.system.darwin module");
190 } else if (is_windows) {
189 if (!build_options.have_llvm)191 if (!build_options.have_llvm)
190 return error.WindowsSdkNotFound;192 return error.WindowsSdkNotFound;
191 var sdk: *ZigWindowsSDK = undefined;193 var sdk: *ZigWindowsSDK = undefined;