I'm just pinging bug #19541 which, despite having patches with several
solutions, isn't assigned to anybody. It's a 8 years old bug...
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19541
Here's the note I added there, FYI:
How difficult is it to add a parameter to add paths to precompiled
header search list *only*?
We have a big code base with #include "pch.h" in some source files.
If source file directory is always searched first for headers, this
breaks out-of-source builds, unless the precompiled header is generated
in the source tree. For read-only source trees, this "solution" is
unacceptable.
The ideal solution would be a parameter like -ipch <path> that adds
<path> to be searched for precompiled headers *before* the current
source directory.
I could spend some time creating a patch, but seeing that others have
come with patches that weren't applied, this kind of demotivate me.
Best regards,
Rodolfo Lima