diff options
author | Justin Bogner <mail@justinbogner.com> | 2013-11-15 18:07:59 +0000 |
---|---|---|
committer | Justin Bogner <mail@justinbogner.com> | 2013-11-15 18:07:59 +0000 |
commit | 13a641b338b33f93dda65bac637277cfbbac2990 (patch) | |
tree | d5d67a8f0d1e7b0ffe5b1c2bdebebd9448234020 /clang/lib/Frontend/InitHeaderSearch.cpp | |
parent | 2e8350b2b9f356d4372491010d49eb7f65e16676 (diff) | |
download | llvm-13a641b338b33f93dda65bac637277cfbbac2990.zip llvm-13a641b338b33f93dda65bac637277cfbbac2990.tar.gz llvm-13a641b338b33f93dda65bac637277cfbbac2990.tar.bz2 |
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.
llvm-svn: 194834
Diffstat (limited to 'clang/lib/Frontend/InitHeaderSearch.cpp')
-rw-r--r-- | clang/lib/Frontend/InitHeaderSearch.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/clang/lib/Frontend/InitHeaderSearch.cpp b/clang/lib/Frontend/InitHeaderSearch.cpp index 53074e2..d144cbb 100644 --- a/clang/lib/Frontend/InitHeaderSearch.cpp +++ b/clang/lib/Frontend/InitHeaderSearch.cpp @@ -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); } } |