]> granicus.if.org Git - clang/commitdiff
Fix Linux libc++ usage. Somehow this slipped through during the port.
authorChandler Carruth <chandlerc@gmail.com>
Mon, 7 Nov 2011 09:01:17 +0000 (09:01 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Mon, 7 Nov 2011 09:01:17 +0000 (09:01 +0000)
Test cases for this and all the rest of the port are still in the works,
but will wait for a fixed computer and post 3.0 merging...

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143916 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/ToolChains.cpp

index fec2209ca8e5b3904babd7f4428d1ad0974a191d..9b84966d81bb2c8833f9352a9822d502d401b256 100644 (file)
@@ -2010,6 +2010,14 @@ void Linux::AddClangCXXStdlibIncludeArgs(const ArgList &DriverArgs,
       DriverArgs.hasArg(options::OPT_nostdincxx))
     return;
 
+  // Check if libc++ has been enabled and provide its include paths if so.
+  if (GetCXXStdlibType(DriverArgs) == ToolChain::CST_Libcxx) {
+    // libc++ is always installed at a fixed path on Linux currently.
+    addSystemInclude(DriverArgs, CC1Args,
+                     getDriver().SysRoot + "/usr/include/c++/v1");
+    return;
+  }
+
   const llvm::Triple &TargetTriple = getTriple();
 
   StringRef CxxIncludeRoot(CXX_INCLUDE_ROOT);