[cfe-dev] How to determine clang's system include dirs, to set in ASTVisitor?

Peeter Joot peeter.joot at gmail.com
Wed Dec 19 06:16:26 PST 2012


If I use llvm-config --cxxflags, it gives me, among other stuff the -I path
for clangs headers.

Is there a way to get the system includes paths that clang uses internally,
either programatically (query set of default system includes for the
target) or on the command line using something like llvm-config, so that I
can set those same paths in my ASTVisitor.  Without that I get include
failures with various system headers:

In file included from xx.C:1:
/vbs/common/osse/core/inc/osstype.h:29:10: fatal error: 'stdlib.h' file not
found
#include <stdlib.h>
         ^

Alternately, is there a way to include the system includes paths by
default?  Looking in

http://clang.llvm.org/doxygen/HeaderSearchOptions_8h_source.html

it appears that UseStandardSystemIncludes, and UseStandardCXXIncludes both
default to true, which explains why setting those didn't make a difference.
 Are those fields not being respected for some reason?

-- 
Peeter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20121219/dca514b2/attachment.html>


More information about the cfe-dev mailing list