• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Possible to exclude precompiled headers per file?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Possible to exclude precompiled headers per file?


  • Subject: Re: Possible to exclude precompiled headers per file?
  • From: Chris Espinosa <email@hidden>
  • Date: Thu, 28 Jan 2010 16:50:17 -0800

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 _______________________________________________
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

References: 
 >Possible to exclude precompiled headers per file? (From: Dan Spirlock <email@hidden>)

  • Prev by Date: Possible to exclude precompiled headers per file?
  • Next by Date: Re: Problem Building FW as a Sub-Project Reference
  • Previous by thread: Possible to exclude precompiled headers per file?
  • Next by thread: xcode 3.2.1 Interface Builder and AppleScript Application
  • Index(es):
    • Date
    • Thread