Re: Recompile issues in Xcode projects
Re: Recompile issues in Xcode projects
- Subject: Re: Recompile issues in Xcode projects
- From: Ray Kiddy <email@hidden>
- Date: Fri, 13 Feb 2009 09:27:00 -0800
On Feb 12, 2009, at 5:53 PM, Emile Tobenfeld wrote:
Hi,
I find that a lot of my Xcode projects will burn their precompiled
headers and rebuild everything if I make any change to the project.
e.g. if I fully build a target (call it "Target 1") and then do any
of the following, XCode will do a full rebuild on the next compile.
1. Switch to Target 2 and then back to Target 1.
2. Add an executable or change the current executable.
3. Adding a file to the target, or to the project.
4. Dragging around an item in the group tree.
Sometimes changing a .cpp file in either the project or a dependency
will also force a full rebuild.
Does anyone on the list know why this happens, and (much more
interesting) how it can be avoided?
Thanks.
The pre-compiled headers are a tool for optimization. They are liked a
cached picture of everything your project needs to know about to
build, so that your project does not have to re-discover everything it
needs to know every time it does a build.
When something invalidates the "everything your project needs to
know", the whole big slab of information needs to be discarded. Change
the LD_LIBRARY_PATH of your project and, as you might guess, the
project's "world view" is shifted and the pre-compiled headers may be
and probably are invalid. Change that environment variable and
anything could change. Xcode cannot assume anything at that point and
must throw away and regenerate the pre-compiled headers.
There are also conditions that cause Xcode to get confused and say
"WTF?" and, not knowing what else to do, it will throw away the pre-
compiled headers. The Xcode team tries to make sure that changes to
the project that could change the "world view" cause a pre-compiled
header regeneration and that changes that do not change the "world
view" do not cause a regeneration. But it is impossible to know
everything, beforehand, about what change might change the "world
view." If they mistakenly keep the header, you are not building what
you think you are building and this is worse than tossing the pre-
compiled headers.
If you are doing something you think is innocuous and Xcode is
removing the pre-compiled headers, that may be a bug and you might
want to file it. But if there is a 1 in a million chance that change
requires it, they will axe the headers. Just FYI. Sorry if this is too
much explanation. Figuring out what should and what should not
invalidate the pre-compiled headers is a really interesting problem.
It is just not one that will ever have a compete answer.
cheers - ray
_______________________________________________
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