From 801aa91790e7cd3c2adabadaf9f10bc59cb2cfea Mon Sep 17 00:00:00 2001 From: Chris Bieneman Date: Fri, 16 Dec 2016 17:30:51 +0000 Subject: [PATCH] [CMake] Put headers relative to clang When libcxx isn't building with an installed LLVM we copy the libcxx headers into the LLVM build directory so that a clang in that build tree can find the headers relative to itself. This is only important in situations where you don't have headers installed under /, which is common these days on Darwin. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@289963 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/CMakeLists.txt | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt index 5969c6fa8..deed1a110 100644 --- a/include/CMakeLists.txt +++ b/include/CMakeLists.txt @@ -10,18 +10,14 @@ set(LIBCXX_HEADER_PATTERN ${LIBCXX_SUPPORT_HEADER_PATTERN} ) -if (LIBCXX_STANDALONE_BUILD) - set(LIBCXX_BUILD_ROOT "${LIBCXX_BINARY_DIR}") -else() - set(LIBCXX_BUILD_ROOT "${LLVM_BINARY_DIR}") +if(NOT LIBCXX_USING_INSTALLED_LLVM) + file(COPY . + DESTINATION "${LLVM_BINARY_DIR}/include/c++/v1" + FILES_MATCHING + ${LIBCXX_HEADER_PATTERN} + ) endif() -file(COPY . - DESTINATION "${LIBCXX_BUILD_ROOT}/include/c++/v1" - FILES_MATCHING - ${LIBCXX_HEADER_PATTERN} -) - if (LIBCXX_INSTALL_HEADERS) install(DIRECTORY . DESTINATION include/c++/v1