]> granicus.if.org Git - clang/commitdiff
Darwin: Look for libc++ headers in include/, rather than lib/
authorJustin Bogner <mail@justinbogner.com>
Fri, 15 Nov 2013 18:07:59 +0000 (18:07 +0000)
committerJustin Bogner <mail@justinbogner.com>
Fri, 15 Nov 2013 18:07:59 +0000 (18:07 +0000)
Up until now we were expecting that when libc++ is installed alongside
clang the headers would be in lib/, which was true if the configure
build was used and false if the cmake build was.

We've now corrected the configure build to install in include/, and
with this change we'll be able to find the correct headers with both
build systems.

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

lib/Frontend/InitHeaderSearch.cpp

index 53074e292435a0652360c38846eb4244102fcf50..d144cbb8945db2f4a32e363f886746cb279bd6a3 100644 (file)
@@ -475,15 +475,17 @@ void InitHeaderSearch::AddDefaultIncludePaths(const LangOptions &Lang,
     if (HSOpts.UseLibcxx) {
       if (triple.isOSDarwin()) {
         // On Darwin, libc++ may be installed alongside the compiler in
-        // lib/c++/v1.
+        // include/c++/v1.
         if (!HSOpts.ResourceDir.empty()) {
           // Remove version from foo/lib/clang/version
           StringRef NoVer = llvm::sys::path::parent_path(HSOpts.ResourceDir);
           // Remove clang from foo/lib/clang
-          SmallString<128> P = llvm::sys::path::parent_path(NoVer);
-          
-          // Get foo/lib/c++/v1
-          llvm::sys::path::append(P, "c++", "v1");
+          StringRef Lib = llvm::sys::path::parent_path(NoVer);
+          // Remove lib from foo/lib
+          SmallString<128> P = llvm::sys::path::parent_path(Lib);
+
+          // Get foo/include/c++/v1
+          llvm::sys::path::append(P, "include", "c++", "v1");
           AddUnmappedPath(P.str(), CXXSystem, false);
         }
       }