diff options
author | Mehdi Amini <mehdi.amini@apple.com> | 2016-11-07 22:07:43 +0000 |
---|---|---|
committer | Mehdi Amini <mehdi.amini@apple.com> | 2016-11-07 22:07:43 +0000 |
commit | 6dc7581c6091a17549ecebcae10f15b987cc9bc1 (patch) | |
tree | de007c1475c5f7ad1b57270dc46a4323ab04fa1a /CMakeLists.txt | |
parent | cd40f257c8676701d72883331644e5aad32dedc2 (diff) |
Fix libcxxabi CMake detection of libcxx path to handle LLVM_EXTERNAL_LIBCXX_SOURCE_DIR flag
Differential Revision: https://reviews.llvm.org/D26364
git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@286161 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 73ec5c5..8923b76 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -137,13 +137,19 @@ if (NOT LIBCXXABI_ENABLE_SHARED AND NOT LIBCXXABI_ENABLE_STATIC) message(FATAL_ERROR "libc++abi must be built as either a shared or static library.") endif() +if (LLVM_EXTERNAL_LIBCXX_SOURCE_DIR) + set(LIBCXXABI_LIBCXX_SRC_DIR ${LLVM_EXTERNAL_LIBCXX_SOURCE_DIR}) +else() + set(LIBCXXABI_LIBCXX_SRC_DIR ${LLVM_MAIN_SRC_DIR}/projects/libcxx/include) +endif() + find_path( LIBCXXABI_LIBCXX_INCLUDES vector PATHS ${LIBCXXABI_LIBCXX_INCLUDES} ${LIBCXXABI_LIBCXX_PATH}/include ${CMAKE_BINARY_DIR}/${LIBCXXABI_LIBCXX_INCLUDES} - ${LLVM_MAIN_SRC_DIR}/projects/libcxx/include + ${LIBCXXABI_LIBCXX_SRC_DIR}/include ${LLVM_INCLUDE_DIR}/c++/v1 ) @@ -155,7 +161,7 @@ find_path( test/libcxx/__init__.py PATHS ${LIBCXXABI_LIBCXX_PATH} ${LIBCXXABI_LIBCXX_INCLUDES}/../ - ${LLVM_MAIN_SRC_DIR}/projects/libcxx/ + ${LIBCXXABI_LIBCXX_SRC_DIR} NO_DEFAULT_PATH ) |