[cfe-commits] [PATCH] Overriding system-header-ness based on #include path

Joerg Sonnenberger joerg at britannica.bec.de
Tue May 29 17:14:31 PDT 2012


On Tue, May 29, 2012 at 04:22:22PM -0700, Richard Smith wrote:
> On Tue, May 29, 2012 at 2:08 PM, Joerg Sonnenberger <joerg at britannica.bec.de
> > wrote:
> > I think you can get
> > the same results with an additional include directory containing
> > symlinks for the 3rd party libraries you don't care about. Which should
> > be both faster and work for a bunch of other compilers as well.
> 
> 
> Adding an additional directory to search on each #include sounds like it
> would be a lot slower than adding a string comparison. Additionally, this
> would require significant build system surgery for existing projects.

If you have one directory tree for them, at most one additional stat.
Build system surgery should be minimal (add the -isystem
$build/sys-includes entry and creating the directory). The reason why I
am a bit perplexed by such a tight coupling (#include with path relative
to the project root for 3rd party libraries) is that it tends to
conflict with the often desirable goal to re-use system libraries as
much as possible and that the 3rd party libraries are normally not
written for such an include style anyway.

JoerG



More information about the cfe-commits mailing list