Re: Framework path in Xcode project
Re: Framework path in Xcode project
- Subject: Re: Framework path in Xcode project
- From: Laurent Daudelin <email@hidden>
- Date: Wed, 2 Jun 2010 12:45:05 -0700
On Jun 2, 2010, at 12:30, Chris Espinosa wrote:
> Be prepared for enlightenment...
>
> In the Ur-times, before SDKs, all Framework references were absolute, and all frameworks were only in /System/Library/Frameworks. The compiler assumed this, and in fact framework references were passed to the compiler and linker by name only, and the path was assumed.
>
> When SDKs were introduced in Xcode 1.0, the Xcode build system implemented them by re-basing all absolute framework paths into the designated SDK and passing those as absolute paths into the compiler. For backwards compatibility the project's absolute path rerences were not changed. So your project might say you were using /System/Library/Frameworks/Foo.framework but Xcode would actually pass /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/Foo.framework to the compiler and linker. This happened silently and tended to confuse people, as navigation and indexing would use a different framework from building.
>
> Then the compiler learned about SDKs and started taking an -isysroot command-line option. This made things easier as Xcode could pass shorter framework flags, and everything would be built from the same SDK. Xcode also started being a little smarter about using frameworks form SDKs for indexing and navigation. Pretty much the only thing used about a framework was its name; the absolute path was rarely used.
>
> Then the iPhone entered the picture, and it became important to really distinguish SDKs because the versions of, say, CoreFoundation can be fairly different between SDKs. And a new Library and Frameworks sheet was added to navigate directly to an SDK's frameworks, rather than making you grope in the file system for them. And the Active SDK popup was introduced to let you switch from one SDK to another on the fly without changing your project settings, to let you switch from the Device to Simulator easily.
>
> With all these it became important to break the absolute path convention and store references to frameworks Relative to Current SDK. That is the standard for newly-added framework references and for new projects and targets. But old code still has the absolute paths, which are still by and large ignored, with the current SDK overriding them (most of the time).
>
> In short: the inconsistency is due to the multiyear transition from system-focused development to SDK-focused development, and is an artifact of backwards compatibility. You can, and probably should, change your framework references to SDK-relative at your convenience, but that should make little or no immediate difference in your projects or workflow.
Thanks for the enlightenment, Chris. You're the best!
-Laurent.
--
Laurent Daudelin
AIM/iChat/Skype:LaurentDaudelin http://nemesys.dyndns.org
Logiciels Nemesys Software email@hidden
Photo Gallery Store: http://laurentdaudelin.shutterbugstorefront.com/g/galleries _______________________________________________
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