summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShoaib Meenai <smeenai@fb.com>2018-06-30 01:04:50 +0000
committerShoaib Meenai <smeenai@fb.com>2018-06-30 01:04:50 +0000
commit777ec3765966e14791aa6289b35a4dc8d8e7aaa3 (patch)
tree74369d6a34b54313abf715de36cd5fc5caccaed2
parent7dcf23ed83d0094386aa438db3b47ec0aacf149d (diff)
downloadbcm5719-llvm-777ec3765966e14791aa6289b35a4dc8d8e7aaa3.tar.gz
bcm5719-llvm-777ec3765966e14791aa6289b35a4dc8d8e7aaa3.zip
[libc++abi] Limit libc++ header search to specified paths
Right now, when libc++abi is locating libc++ headers, it specifies several search locations, but it also doesn't prevent CMake from looking for those headers in system directories. I don't know if this was intentional or an oversight, but it has several issues: * We're looking specifically for the vector header, which could just as easily be found in a libstdc++ (or other C++ library) installation. * No system I know of places their C++ headers directly in system include directories (they're always under a C++ subdirectory), so the system search will never succeed. * find_path searches system paths before the user-specified PATHS, so if some system does happen to have C++ headers in its system include directories, those headers will be preferred, which doesn't seem desirable. It makes sense to me to limit this header search to the explicitly specified paths (using NO_DEFAULT_PATH, as is done for the other find_path call in this file), but I'm putting it up for review in case there's some use case I'm not thinking of. Differential Revision: https://reviews.llvm.org/D48694 llvm-svn: 336032
-rw-r--r--libcxxabi/CMakeLists.txt1
1 files changed, 1 insertions, 0 deletions
diff --git a/libcxxabi/CMakeLists.txt b/libcxxabi/CMakeLists.txt
index c92be5f56a5..f8892e50bf3 100644
--- a/libcxxabi/CMakeLists.txt
+++ b/libcxxabi/CMakeLists.txt
@@ -116,6 +116,7 @@ find_path(
${CMAKE_BINARY_DIR}/${LIBCXXABI_LIBCXX_INCLUDES}
${LIBCXXABI_LIBCXX_INCLUDE_DIRS}
${LLVM_INCLUDE_DIR}/c++/v1
+ NO_DEFAULT_PATH
NO_CMAKE_FIND_ROOT_PATH
)
OpenPOWER on IntegriCloud