On Jun 12, 2007, at 9:36 PM, Adam wrote: I looked around in the Xcode documentation, but I couldn't find anything on the topic. I have a header file that I made, and I change it often. After I change it, I want Xcode to rebuild the header when I build the project, but it won't because of the pre-built headers thing. How do I fix this?
Do you have a header that is #included by your precompiled header prefix file?
The simple answer is this: don't include your project headers in your prefix file if you're changing them often. That totally loses the value of precompilation. Just have the prefix file compile the system headers that don't change. That way they a) won't be rebuilt, saving time, and b) won't be out of sync with your local header file changes.
To answer the specific question, just uncheck the "Precompile Prefix Header" build setting in your target. But that will not be satisfying; it'll probably double or triple your build time every time regardless of whether you make a change or not.
If you find that Xcode is not picking up changes you make in a header file when you rebuild, try these:
- Make sure the header file is a project member. It doesn't have to be in a target, just in the project so Xcode indexes it and notes changes to it. - Make sure the #include path to it is correct and unambiguous. (Case-correct is important.) - There are known problems in Xcode 2 with files referred to by paths that look like "../myheader.h". You may need to manually touch a source file that includes the header in order to get the header change to be recognized in such circumstances.
Chris
|