diff options
author | Petr Hosek <phosek@chromium.org> | 2017-12-12 01:20:52 +0000 |
---|---|---|
committer | Petr Hosek <phosek@chromium.org> | 2017-12-12 01:20:52 +0000 |
commit | eff015538b70adcb9f3976ac8d2181513e28c1c1 (patch) | |
tree | 8ba95e68041087146a1ae57a941f47da8af4e706 /CMakeLists.txt | |
parent | 9b3f7c3d180b156605b9def01ce16465baee9c1c (diff) |
[CMake] Support runtimes and monorepo layouts when looking for libcxx
This also slightly refactors the code that's checking the directory
presence which allows eliminating one unnecessary variable.
Differential Revision: https://reviews.llvm.org/D40637
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@320446 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index e791089fe..4b953b212 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -344,17 +344,15 @@ endif() add_subdirectory(include) -set(COMPILER_RT_LIBCXX_PATH ${LLVM_MAIN_SRC_DIR}/projects/libcxx) -if(EXISTS ${COMPILER_RT_LIBCXX_PATH}/) - set(COMPILER_RT_HAS_LIBCXX_SOURCES TRUE) -else() - set(COMPILER_RT_LIBCXX_PATH ${LLVM_MAIN_SRC_DIR}/../libcxx) - if(EXISTS ${COMPILER_RT_LIBCXX_PATH}/) - set(COMPILER_RT_HAS_LIBCXX_SOURCES TRUE) - else() - set(COMPILER_RT_HAS_LIBCXX_SOURCES FALSE) +foreach(path IN ITEMS ${LLVM_MAIN_SRC_DIR}/projects/libcxx + ${LLVM_MAIN_SRC_DIR}/runtimes/libcxx + ${LLVM_MAIN_SRC_DIR}/../libcxx + ${LLVM_EXTERNAL_LIBCXX_SOURCE_DIR}) + if(IS_DIRECTORY ${path}) + set(COMPILER_RT_LIBCXX_PATH ${path}) + break() endif() -endif() +endforeach() set(COMPILER_RT_LLD_PATH ${LLVM_MAIN_SRC_DIR}/tools/lld) if(EXISTS ${COMPILER_RT_LLD_PATH}/ AND LLVM_TOOL_LLD_BUILD) |