diff options
author | Shoaib Meenai <smeenai@fb.com> | 2019-01-14 20:33:30 +0000 |
---|---|---|
committer | Shoaib Meenai <smeenai@fb.com> | 2019-01-14 20:33:30 +0000 |
commit | eb0ed5f2feaf34d30fb1c37b973554f3e4805964 (patch) | |
tree | ce47c34eb41063aa3d3ba0f7c0199e20e582cf70 /CMakeLists.txt | |
parent | a0606824921f42f77963b7221e810796630a36c3 (diff) | |
download | compiler-rt-eb0ed5f2feaf34d30fb1c37b973554f3e4805964.tar.gz |
[compiler-rt] Add option to disable libc++ build
Having libc++ checked out doesn't necessarily mean it should be built;
for example, the same source tree might be used for multiple build
configurations, and libc++ might not build in some of those
configurations. Add an option to compiler-rt's build to disable building
libc++. This defaults to ON, so it shouldn't change any existing build
configurations.
Differential Revision: https://reviews.llvm.org/D56479
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@351117 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index ab69c5136..aa360a3ef 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -428,15 +428,19 @@ endif() add_subdirectory(include) -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() -endforeach() +option(COMPILER_RT_USE_LIBCXX + "Enable compiler-rt to use libc++ from the source tree" ON) +if(COMPILER_RT_USE_LIBCXX) + 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() + endforeach() +endif() set(COMPILER_RT_LLD_PATH ${LLVM_MAIN_SRC_DIR}/tools/lld) if(EXISTS ${COMPILER_RT_LLD_PATH}/ AND LLVM_TOOL_LLD_BUILD) |