Skip to content

Conversation

@kubkon
Copy link
Member

@kubkon kubkon commented Aug 20, 2023

This is a follow-up to #16058 and moves framework path resolution from the linker to the frontend. Here's what this now looks like:

$ zig cc hello.c -framework Foo
error: unable to find framework 'Foo'. searched paths: 
 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/System/Library/Frameworks/Foo.framework/Foo.tbd
 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/System/Library/Frameworks/Foo.framework/Foo.dylib

$ zig cc hello.c -framework Foundation
$ otool -lv a.out | grep Foundation
         name /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (offset 24)

@kubkon kubkon requested a review from andrewrk August 20, 2023 08:51
Copy link
Member

@andrewrk andrewrk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! I think this can be merged as is, however, I do see a possible improvement:

We can infer the framework name from the included resolved framework
path.

Fix hash implementation, and bump linker hash value from 9 to 10.
@kubkon kubkon enabled auto-merge August 21, 2023 06:57
@kubkon kubkon merged commit 8e96be0 into master Aug 21, 2023
@kubkon kubkon deleted the macho-frameworks branch August 21, 2023 09:01
moosichu added a commit to moosichu/zig that referenced this pull request Oct 15, 2023
Pull request ziglang#16888 removed searching for libraries with no extensions
when linking frameworks... this adds that feature back.
moosichu added a commit to moosichu/zig that referenced this pull request Oct 15, 2023
Pull request ziglang#16888 removed searching for libraries with no extensions
when linking frameworks... this adds that feature back.
moosichu added a commit to moosichu/zig that referenced this pull request Oct 15, 2023
Pull request ziglang#16888 removed searching for libraries with no extensions
when linking frameworks... this adds that feature back.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants