r194834 - Darwin: Look for libc++ headers in include/, rather than lib/

Justin Bogner mail at justinbogner.com
Fri Nov 15 10:07:59 PST 2013


Author: bogner
Date: Fri Nov 15 12:07:59 2013
New Revision: 194834

URL: http://llvm.org/viewvc/llvm-project?rev=194834&view=rev
Log:
Darwin: Look for libc++ headers in include/, rather than lib/

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.

Modified:
    cfe/trunk/lib/Frontend/InitHeaderSearch.cpp

Modified: cfe/trunk/lib/Frontend/InitHeaderSearch.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/InitHeaderSearch.cpp?rev=194834&r1=194833&r2=194834&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/InitHeaderSearch.cpp (original)
+++ cfe/trunk/lib/Frontend/InitHeaderSearch.cpp Fri Nov 15 12:07:59 2013
@@ -475,15 +475,17 @@ void InitHeaderSearch::AddDefaultInclude
     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);
         }
       }





More information about the cfe-commits mailing list