aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJakub Konka <kubkon@jakubkonka.com>2023-10-16 20:45:04 +0200
committerGitHub <noreply@github.com>2023-10-16 20:45:04 +0200
commit78f2ae7f29ff537e63227d7e88e555178fed2a34 (patch)
treea2443684b20289d04d9a666451945160793cff0b /src
parent7b9165b37576ed4c4962c0ad2afb62921524aa08 (diff)
parent023d1ac6bf25c941510509ddbb659c73947ec39b (diff)
downloadzig-78f2ae7f29ff537e63227d7e88e555178fed2a34.tar.gz
zig-78f2ae7f29ff537e63227d7e88e555178fed2a34.zip
Merge pull request #17531 from moosichu/fix/frameworks
Fix some frameworks not linking macos
Diffstat (limited to 'src')
-rw-r--r--src/link/MachO.zig11
-rw-r--r--src/main.zig4
2 files changed, 13 insertions, 2 deletions
diff --git a/src/link/MachO.zig b/src/link/MachO.zig
index f54a370a26..425dffd6b1 100644
--- a/src/link/MachO.zig
+++ b/src/link/MachO.zig
@@ -707,6 +707,17 @@ fn accessLibPath(
return true;
}
+ noextension: {
+ test_path.clearRetainingCapacity();
+ try test_path.writer().print("{s}" ++ sep ++ "{s}", .{ search_dir, lib_name });
+ try checked_paths.append(try gpa.dupe(u8, test_path.items));
+ fs.cwd().access(test_path.items, .{}) catch |err| switch (err) {
+ error.FileNotFound => break :noextension,
+ else => |e| return e,
+ };
+ return true;
+ }
+
return false;
}
diff --git a/src/main.zig b/src/main.zig
index 0f0c2b4927..fe8c871ce8 100644
--- a/src/main.zig
+++ b/src/main.zig
@@ -6956,9 +6956,9 @@ fn accessFrameworkPath(
) !bool {
const sep = fs.path.sep_str;
- for (&[_][]const u8{ "tbd", "dylib" }) |ext| {
+ for (&[_][]const u8{ ".tbd", ".dylib", "" }) |ext| {
test_path.clearRetainingCapacity();
- try test_path.writer().print("{s}" ++ sep ++ "{s}.framework" ++ sep ++ "{s}.{s}", .{
+ try test_path.writer().print("{s}" ++ sep ++ "{s}.framework" ++ sep ++ "{s}{s}", .{
framework_dir_path,
framework_name,
framework_name,