Re: Embedding a Framework
Re: Embedding a Framework
- Subject: Re: Embedding a Framework
- From: Roland King <email@hidden>
- Date: Fri, 25 Jul 2014 07:51:15 +0800
> On 24 Jul 2014, at 11:50 pm, Jerry Krinock <email@hidden> wrote:
>
> If I understand you correctly, you are shipping your framework in the Contents/Frameworks/ subdirectory of the application package. I have apps which work the same way. When I otool -l their binaries, I get:
>
> Load command 11
> cmd LC_LOAD_DYLIB
> cmdsize 96
> name @executable_path/../Frameworks/Bkmxwork.framework/Versions/A/Bkmxwork (offset 24)
> time stamp 2 Wed Dec 31 16:00:02 1969
> current version 1.0.0
> compatibility version 1.0.0
Right, that’s what I wanted mine to say, not /Library/Frameworks/pcapng.framework/… but @rpath/pcapng.framework. So the question was why does yours link as an executable path relative and mine as a full path name?
>
>> Is my only option using install_name_tool and changing the name to an @rpath or similar (which is a bit horrid) or is there a way to tell Xcode to embed the Framework in the binary with a binary-relative path when it builds and copies it so the App binary is consistent from the get-go?
>
> In my framework target, Buid Settings, at the “framework” level, I have set Installation Directory to
>
> @executable_path/../Frameworks
>
And that is the piece I was missing! My incorrect guess was that linking a framework in with a binary embedded the framework and set the loader paths appropriately, but no, it’s all to do with how the framework is linked originally. I changed the Installation Directory to ‘@rpath’ and now it’s happy.
So now I have a framework I need to link differently for embedding than I do if I want to install it. This is probably the third time now in as many months I’ve really wanted to have an extra set of build preferences which, when building a target with embedded other targets, let me override the build settings on those targets, just a few of them. ie in this case when building the overall target which builds the embedded pcap it would be great to just override that install directory setting on the pcap framework, leaving the usual project unaffected.
.. one more bug report this week won’t kill me.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden