authorgravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2022-07-22 14:32:56+02:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-07-22 14:11:23-07:00
logeb1b2f5c58888bfcab7e00378502f82594536aec
tree89435c4aca842324cc5c7fa6b91373ca97ae2c35
parent5dd59a54238b63cb52bb91d3cf803cb0196abb64

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.

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

lib/std/zig/system/NativePaths.zig+6-5
...@@ -84,14 +84,15 @@ pub fn detect(allocator: Allocator, native_info: NativeTargetInfo) !NativePaths...@@ -84,14 +84,15 @@ pub fn detect(allocator: Allocator, native_info: NativeTargetInfo) !NativePaths
8484
85 if (comptime builtin.target.isDarwin()) {85 if (comptime builtin.target.isDarwin()) {
86 try self.addIncludeDir("/usr/include");86 try self.addIncludeDir("/usr/include");
87 try self.addIncludeDir("/usr/local/include");
88
89 try self.addLibDir("/usr/lib");87 try self.addLibDir("/usr/lib");
90 try self.addLibDir("/usr/local/lib");
91
92 try self.addFrameworkDir("/Library/Frameworks");
93 try self.addFrameworkDir("/System/Library/Frameworks");88 try self.addFrameworkDir("/System/Library/Frameworks");
9489
90 if (builtin.target.os.version_range.semver.min.major < 11) {
91 try self.addIncludeDir("/usr/local/include");
92 try self.addLibDir("/usr/local/lib");
93 try self.addFrameworkDir("/Library/Frameworks");
94 }
95
95 return self;96 return self;
96 }97 }
9798