• 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: Gratuitous rebuilds in Xcode 2.3
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Gratuitous rebuilds in Xcode 2.3


  • Subject: Re: Gratuitous rebuilds in Xcode 2.3
  • From: leenoori <email@hidden>
  • Date: Tue, 5 Dec 2006 15:15:23 +0100

El 5/12/2006, a las 6:23, Chris Espinosa escribió:

Each PCH folder has a name like "PluginLibrary-xxx" where xxx is some 28-letter lowercase hash. Could this be some weirdness due to using subprojects?

Nope, this is indeed a hash, and it's a first-line indication to Xcode whether it can reuse a precomp across projects. Xcode hashes the prefix file path and compiler flags, and if it finds a precomp that matches that hash, it uses it; if not, it generates a new one.

After reading this very interesting thread I decided to try and optimize my build process (which contains many projects and targets with lots of interdependencies) so as to maximize precompiled header sharing.


Basically, the idea was to pick a relatively "safe" header to use for precompilation (Cocoa.h) and keep the common compiler flags as constant as possible over all the projects/targets (with the aid of xcconfig files).

I ran into some totally bizarre and puzzling error messages but finally got it all sorted out. For example, in one project I noticed that the precomp header was being compiled not once but twice for each architecture, and spewing out a bunch of error messages in the process. I eventually found out that the cause was that that project had some straight C files in it, not just Objective-c files, and so Xcode was trying to precompile Cocoa.h once as Objective-C and once as normal C, which of course produced a couple thousand errors.

The build setting I needed to correct this problem was GCC_PFE_FILE_C_DIALECTS. If you want to play with precomp headers I suggest you type "precomp" in the build settings search field and you will find out a fair bit of info about some interesting precomp- related settings. For the time being I am running with:

PRECOMPS_INCLUDE_HEADERS_FROM_BUILT_PRODUCTS_DIR = NO
GCC_PRECOMPILE_PREFIX_HEADER = YES
GCC_INCREASE_PRECOMPILED_HEADER_SHARING = YES
GCC_USE_GCC3_PFE_SUPPORT = YES
GCC_PFE_FILE_C_DIALECTS = objective-c objective-c++

I am still seeing quite a few variations of the precomp headers being built (lots of different hashes in the shared precomp dir) so I still have some investigation to do to figure out which build settings are responsible for the different hashes. I guess the best case scenario for any given target type will be about three precomps (one native arch precomp with debug settings in place, plus two more -- i386 and ppc - for release builds).

_______________________________________________
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: 
 >Re: Gratuitous rebuilds in Xcode 2.3 (From: Jim Wintermyre <email@hidden>)
 >Re: Gratuitous rebuilds in Xcode 2.3 (From: Chris Espinosa <email@hidden>)

  • Prev by Date: RE: Universal binary crash on quit on 10.3.9
  • Next by Date: unit testing with SenTestingKit, please hold my hand
  • Previous by thread: Re: Gratuitous rebuilds in Xcode 2.3
  • Next by thread: Re: Gratuitous rebuilds in Xcode 2.3
  • Index(es):
    • Date
    • Thread