summaryrefslogtreecommitdiff
path: root/lib/Frontend/InitHeaderSearch.cpp
diff options
context:
space:
mode:
authorJustin Bogner <mail@justinbogner.com>2013-11-15 18:07:59 +0000
committerJustin Bogner <mail@justinbogner.com>2013-11-15 18:07:59 +0000
commitc3e16a2f1cbb4d08aec1b9b567afa97cd083bc4e (patch)
treecbaced7f508207f0a18465610596d708f9f4cb3a /lib/Frontend/InitHeaderSearch.cpp
parent3604841af31cbd337ffab781a7fe81a68a1455f0 (diff)
downloadclang-c3e16a2f1cbb4d08aec1b9b567afa97cd083bc4e.tar.gz
clang-c3e16a2f1cbb4d08aec1b9b567afa97cd083bc4e.tar.bz2
clang-c3e16a2f1cbb4d08aec1b9b567afa97cd083bc4e.tar.xz
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194834 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/InitHeaderSearch.cpp')
-rw-r--r--lib/Frontend/InitHeaderSearch.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/Frontend/InitHeaderSearch.cpp b/lib/Frontend/InitHeaderSearch.cpp
index 53074e2924..d144cbb894 100644
--- a/lib/Frontend/InitHeaderSearch.cpp
+++ b/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);
}
}