Re: How to include/exclude frameworks conditionally, based on configuration?
Re: How to include/exclude frameworks conditionally, based on configuration?
- Subject: Re: How to include/exclude frameworks conditionally, based on configuration?
- From: Ken Thomases <email@hidden>
- Date: Thu, 16 Dec 2010 13:28:19 -0600
On Dec 16, 2010, at 12:46 PM, Oleg Krupnov wrote:
> I have two configurations of my project. One configuration should
> include some Framework, the other should exclude it.
>
> In .m and .h files, I switch the #imports of that framework using
> #ifdef directives, but how do I also prevent the framework from being
> linked and copied into the resulting app bundle?
With respect to linking, you remove the framework from the target and then put "-framework <whatever>" into the Other Linker Flags build setting. The build setting can be different for each configuration.
With respect to copying, you have to switch to using a run-script build phase to do the copying and implement the conditional logic yourself. You can receive the build settings as environment variables.
Fundamentally, targets are the mechanism which decides which inputs are collected and processed to produce an output (a.k.a. product). Configurations affect build settings, controlling how those inputs are processed. What you're hoping to do doesn't fit cleanly into this paradigm, so you have to kludge it.
Regards,
Ken
_______________________________________________
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