Re: [FAQ] Sharing Xcode precompiled headers across projects
Re: [FAQ] Sharing Xcode precompiled headers across projects
- Subject: Re: [FAQ] Sharing Xcode precompiled headers across projects
- From: Scott Tooker <email@hidden>
- Date: Wed, 18 Jan 2006 11:24:40 -0800
I haven't heard of this problem before, please file a bug at
bugreporter.apple.com.
Scott
On Jan 18, 2006, at 5:44 AM, Steve Baxter wrote:
Hi Chris,
I'm just trying to get .xcconfig files working, unfortunately I
have run into a problem - HEADER_SEARCH_PATHS does not seem to work
in a .xcconfig file if you have specified a recursive path.
Here is the line from my .xcconfig file:
HEADER_SEARCH_PATHS = "../X-Platform//**" "../../../Mac//**"
"../../../X-Platform//**" "../..//**" "/Developer/Headers/FlatCarbon"
In Xcode though, everything after the first * is ignored - the
setting that Xcode thinks it has is:
"../X-Platform//
Is this a known bug? Is there any way around this?
Cheers,
Steve.
On 17 Jan 2006, at 20:30, Chris Espinosa wrote:
On Jan 17, 2006, at 10:32 AM, Steve Baxter wrote:
I have a set of about 80 projects - a shared framework, 2
applications and about 77 modules. These projects all use the
same prefix file.
The problem is that Xcode precompiles a prefix file for each of
my projects. This is very slow, and at 40MB/project is going to
cause me trouble with disk space on my laptop machine. How can I
get Xcode to share precompiled headers across multiple projects?
On another note, Xcode seems to rebuild the precompiled header if
I look at the settings for a project (look but don't change).
Firstly surely it should be smart enough not to recompile this
unless it really has to, secondly why is looking at settings for
a project or target causing the project.pbxproj to get touched?
This is a really big problem as it can take over 30 minutes to
rebuild the larger projects from scratch!
The two main tools you use to make this happen are
shared .xcconfig files and the Preprocessor Macros Not Used In
Precomiled Headers build setting.
When deciding whether to reuse an existing shared precomp or
generate a new one, Xcode considers all build settings that can
affect the generation of the headers. So to maximize the
probability of sharing headers, you should share as many build
settings as possible among your similar targets. The best way to
do this is to factor out your settings into a
CommonSettings.xcconfig file and set the "Based On:" setting in
your targets to use this common file.
To tell which settings are differing and making Xcode create
separate precomps, follow these steps:
1) Open /Developer/Applications/Utilities/FileMerge.app
2) In the Finder, Go to Folder /Library/Caches/
com.Apple.Xcode.<your UID>/SharedPrecompiledHeaders
3) Find two folders with similar names (based on your prefix file)
that you expected would be shared.
4) In Outline view, turn down the folders so you see the
<prefixname>.gch.hash-criteria files inside those folders
5) Drag those files, one at a time, to the "Left" and "Right"
wells in FileMerge's Open dialog
You'll see a comparison of what criteria caused Xcode to generate
separate precompiled header files. If you can consolidate or
eliminate those flags, Xcode will reuse the precompiled header.
If the flags are -D flags (preprocessor macros), you can try
moving those "Preprocessor Macros" to the "Preprocessor Macros Not
Used in Precompiled Headers" build setting, and they won't be
considered in the hash criteria. Note that this is at your own
risk: if one of your precompiled headers actually uses that flag,
and it's different at build time, your results will be inaccurate.
Chris
Stephen Baxter
Software Development Manager
Improvision
email@hidden
+44-2476-692229
_______________________________________________
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
_______________________________________________
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