Re: Possible to exclude precompiled headers per file?
Re: Possible to exclude precompiled headers per file?
- Subject: Re: Possible to exclude precompiled headers per file?
- From: Chris Espinosa <email@hidden>
- Date: Fri, 29 Jan 2010 10:48:04 -0800
On Jan 29, 2010, at 10:00 AM, Dan Spirlock wrote:
>> On Jan 28, 2010, at 4:34 PM, Dan Spirlock wrote:
>>
>>> I have a project that uses a precompiled header. I want all of my source files to use the precompiled header except for one file. I know in Visual Studio you can set precompiled header settings on a per file basis. Is this possible in Xcode? So far, I've only been able to find a way to include or exclude precompiled headers for the whole target.
>>
>> No, Xcode doesn't really have a facility for this. You can add compiler flags on a per-file basis but you can't generally change build settings per-file.
>>
>> Unfortunately the best approach is to create a Static Library target for the one file, set that target to the identical build settings of the current target except for the precompiled header, then add the target's resulting .a file to the original target.
>>
>> You can mass-propagate build settings with Select All / Copy / Paste, or (better yet) create .xcconfig files for the build settings shared between the two targets and have both targets Based On the same .xcconfig.
>>
>> Chris
>>
>> ------------------------------
>
> Thank you, Chris. Your solution would definitely work, but it seems like more of a workaround than anything. Not sure if this is the right place for feature requests, but it would be great if there were at least a subset of build settings that were configurable on a per-file basis. For situations like this it is quite convenient.
The right place for feature requests is http://bugreporter.apple.com and so far as I know this has not been requested, so file away.
Chris _______________________________________________
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