Skip to content

Commit 78f2ae7

Browse files
authored
Merge pull request #17531 from moosichu/fix/frameworks
Fix some frameworks not linking macos
2 parents 7b9165b + 023d1ac commit 78f2ae7

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

src/link/MachO.zig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -707,6 +707,17 @@ fn accessLibPath(
707707
return true;
708708
}
709709

710+
noextension: {
711+
test_path.clearRetainingCapacity();
712+
try test_path.writer().print("{s}" ++ sep ++ "{s}", .{ search_dir, lib_name });
713+
try checked_paths.append(try gpa.dupe(u8, test_path.items));
714+
fs.cwd().access(test_path.items, .{}) catch |err| switch (err) {
715+
error.FileNotFound => break :noextension,
716+
else => |e| return e,
717+
};
718+
return true;
719+
}
720+
710721
return false;
711722
}
712723

src/main.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6956,9 +6956,9 @@ fn accessFrameworkPath(
69566956
) !bool {
69576957
const sep = fs.path.sep_str;
69586958

6959-
for (&[_][]const u8{ "tbd", "dylib" }) |ext| {
6959+
for (&[_][]const u8{ ".tbd", ".dylib", "" }) |ext| {
69606960
test_path.clearRetainingCapacity();
6961-
try test_path.writer().print("{s}" ++ sep ++ "{s}.framework" ++ sep ++ "{s}.{s}", .{
6961+
try test_path.writer().print("{s}" ++ sep ++ "{s}.framework" ++ sep ++ "{s}{s}", .{
69626962
framework_dir_path,
69636963
framework_name,
69646964
framework_name,

0 commit comments

Comments
 (0)