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 | 6e39af016fd8bbcf06adc5ef2d9b93de30648ff3 (patch) | |
| tree | 777a302e1aaef3b90d2ec1a3a7642345c3fcacb8 | |
| parent | 58c650454385ea7d6c65296d7dda9393feaff66d (diff) | |
| download | bcm5719-llvm-6e39af016fd8bbcf06adc5ef2d9b93de30648ff3.tar.gz bcm5719-llvm-6e39af016fd8bbcf06adc5ef2d9b93de30648ff3.zip | |
[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
llvm-svn: 351117
| -rw-r--r-- | compiler-rt/CMakeLists.txt | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/compiler-rt/CMakeLists.txt b/compiler-rt/CMakeLists.txt index ab69c513636..aa360a3ef36 100644 --- a/compiler-rt/CMakeLists.txt +++ b/compiler-rt/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) |

