diff options
author | Filipe Cabecinhas <me@filcab.net> | 2016-03-01 14:08:13 +0000 |
---|---|---|
committer | Filipe Cabecinhas <me@filcab.net> | 2016-03-01 14:08:13 +0000 |
commit | 9f05d3f0a0358d06d4807aac0d6f26979178cd84 (patch) | |
tree | 9b7b720b5975103f4e7405b3843a0a36770efffe /runtime/CMakeLists.txt | |
parent | 00f1f5cba25087520ab58cbe71af8cbe497a82ed (diff) | |
download | clang-9f05d3f0a0358d06d4807aac0d6f26979178cd84.tar.gz |
[cmake] Fallback to LLVM_EXTERNAL_COMPILER_RT_SOURCE_DIR if COMPILER_RT_SRC_ROOT doesn't exist.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@262334 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'runtime/CMakeLists.txt')
-rw-r--r-- | runtime/CMakeLists.txt | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/runtime/CMakeLists.txt b/runtime/CMakeLists.txt index 3a3efa0bf7..5c1d7deb26 100644 --- a/runtime/CMakeLists.txt +++ b/runtime/CMakeLists.txt @@ -23,6 +23,13 @@ function(get_ext_project_build_command out_var target) endfunction() set(COMPILER_RT_SRC_ROOT ${LLVM_MAIN_SRC_DIR}/projects/compiler-rt) +# Fallback to the external path, if the other one isn't available. +# This is the same behavior (try "internal", then check the LLVM_EXTERNAL_... +# variable) as in add_llvm_external_project +if(NOT EXISTS ${COMPILER_RT_SRC_ROOT}) + set(COMPILER_RT_SRC_ROOT ${LLVM_EXTERNAL_COMPILER_RT_SOURCE_DIR}) +endif() + if(LLVM_BUILD_EXTERNAL_COMPILER_RT AND EXISTS ${COMPILER_RT_SRC_ROOT}/) if(CMAKE_VERSION VERSION_GREATER 3.3.20150708) set(cmake_3_4_USES_TERMINAL_OPTIONS |