Re: Per-configuration target membership
Re: Per-configuration target membership
- Subject: Re: Per-configuration target membership
- From: Fritz Anderson <email@hidden>
- Date: Tue, 17 Sep 2013 10:11:22 -0500
On 14 Sep 2013, at 3:17 PM, Rick Mann <email@hidden> wrote:
> Is there still no clean way to set per-configuration target membership? I have a statically-linked framework that I wish to include in my target only for debug builds. It seems the only way to do that is Other Linker Flags and -framework, but this is so kludgy. Is there (still) no place in the UI to specify that a framework belongs to a target only for certain configurations?
Not in the UI. Its model of configurations and targets is orthogonal to what you're hoping. Because it's a design choice, it's unlikely Apple will ever cloud an already-complicated configuration story with a contradictory one.
A target has members, a product (or products in the case of composite targets), and a set of configurations, the names of which it draws from the project. The set of members is part of the definition of a target. It works out to: If you want a different file set, by definition you want a different target. That's the solution Xcode will most transparently support.
Duplicate the existing target. After that, you'll have to remember to allocate new files to both targets (or your choice between them), but the UI supports that pretty cleanly. You can coordinate build settings by having them share an .xcconfig file. (As of Xcode 4, creating one from an existing build configuration was perversely difficult. Maybe Xcode 5 supports it better.)
There are tricks, among them the per-configuration link flags you're using. Another that occurs to me is to guard the source you want to exclude with #if, #ifdef, or #ifndef directives, and set the flag macros per-configuration in the build settings. I'm sorry I don't have time to organize my thoughts on any others. If you insist on cutting across Xcode's project model, anything you do will be ugly.
— F
_______________________________________________
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