Browse Source

Pass the path of clang includes to ResourceDir (#888)

pull/891/head
Mohit Mohta 8 years ago committed by Dimitar Dobrev
parent
commit
ed5eab6add
  1. 18
      src/CppParser/Parser.cpp

18
src/CppParser/Parser.cpp

@ -340,6 +340,16 @@ void Parser::SetupHeader() @@ -340,6 +340,16 @@ void Parser::SetupHeader()
if (opts->verbose)
HSOpts.Verbose = true;
#ifndef __APPLE__
// Initialize the default platform headers.
HSOpts.ResourceDir = GetClangResourceDir();
llvm::SmallString<128> ResourceDir(HSOpts.ResourceDir);
llvm::sys::path::append(ResourceDir, "include");
HSOpts.AddPath(ResourceDir.str(), clang::frontend::System, /*IsFramework=*/false,
/*IgnoreSysRoot=*/false);
#endif
for (unsigned I = 0, E = opts->IncludeDirs.size(); I != E; ++I)
{
const auto& s = opts->IncludeDirs[I];
@ -364,14 +374,6 @@ void Parser::SetupHeader() @@ -364,14 +374,6 @@ void Parser::SetupHeader()
PPOpts.addMacroUndef(undefine);
}
// Initialize the default platform headers.
HSOpts.ResourceDir = GetClangResourceDir();
llvm::SmallString<128> ResourceDir(HSOpts.ResourceDir);
llvm::sys::path::append(ResourceDir, "include");
HSOpts.AddPath(ResourceDir.str(), clang::frontend::System, /*IsFramework=*/false,
/*IgnoreSysRoot=*/false);
#ifdef _MSC_VER
if (opts->microsoftMode)
{

Loading…
Cancel
Save