[cfe-dev] MinGW header search paths (InitHeaderSearch.cpp)

Eric Christopher echristo at apple.com
Fri Apr 22 14:59:09 PDT 2011


On Apr 22, 2011, at 2:54 PM, Ruben Van Boxem wrote:

> 2011/4/22 Douglas Gregor <dgregor at apple.com>
> 
> On Apr 22, 2011, at 12:25 PM, Reid Kleckner wrote:
> 
> > I didn't interpret his suggestion that way, I thought it was more
> > along the lines of doing what the 'which gcc' command does.
> 
> Ah, my mistake. We could try that for mingw at least. In general, it doesn't work as well as actually invoking GCC, since every build of GCC seems to like to put its standard library in a different place.
> 
> 
> That was indeed my plan. We can perhaps read the <gcclocation>/../include/c++/ subfolders with random/all versions/targets and add them to the search directories. Once libcxx works with mingw and on windows in general, we can get rid of this foolishness and just add the <clang(++)location>/../include(/c++) and be done with it (for Windows at least).
> 

This still sounds pretty ugly. I'd be more for a configure time and a flag at runtime if you want to override it.

> Does Clang have any functions to read files/directories or is that a task for the Win32 API?

llvm has some. Look in llvm/lib/Support

-eric



More information about the cfe-dev mailing list