From eb1b2f5c58888bfcab7e00378502f82594536aec Mon Sep 17 00:00:00 2001 From: Jakub Konka Date: Fri, 22 Jul 2022 14:32:56 +0200 Subject: [PATCH] macos: add /usr/local/* paths conditional on macOS major version `/usr/local/include`, `/usr/local/lib` and `/Library/Frameworks` have been deprecated since approximately macOS 11, and so to avoid redundant and misinformed warning messages generated by the linker, add those dirs only when natively targeting macOS 10.x.x or below. --- lib/std/zig/system/NativePaths.zig | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/std/zig/system/NativePaths.zig b/lib/std/zig/system/NativePaths.zig index 8e3e46e4819889915249d56e1c558a780b09d002..e9e7460314654d3974c9d804034e9e951516b062 100644 --- a/lib/std/zig/system/NativePaths.zig +++ b/lib/std/zig/system/NativePaths.zig @@ -84,14 +84,15 @@ pub fn detect(allocator: Allocator, native_info: NativeTargetInfo) !NativePaths if (comptime builtin.target.isDarwin()) { try self.addIncludeDir("/usr/include"); - try self.addIncludeDir("/usr/local/include"); - try self.addLibDir("/usr/lib"); - try self.addLibDir("/usr/local/lib"); - - try self.addFrameworkDir("/Library/Frameworks"); try self.addFrameworkDir("/System/Library/Frameworks"); + if (builtin.target.os.version_range.semver.min.major < 11) { + try self.addIncludeDir("/usr/local/include"); + try self.addLibDir("/usr/local/lib"); + try self.addFrameworkDir("/Library/Frameworks"); + } + return self; } -- 2.54.0