Skip to content

Commit 03ca68d

Browse files
committed
[cmake] Fallback to LLVM_EXTERNAL_COMPILER_RT_SOURCE_DIR if COMPILER_RT_SRC_ROOT doesn't exist.
llvm-svn: 262334
1 parent 0ddfde4 commit 03ca68d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

clang/runtime/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@ function(get_ext_project_build_command out_var target)
2323
endfunction()
2424

2525
set(COMPILER_RT_SRC_ROOT ${LLVM_MAIN_SRC_DIR}/projects/compiler-rt)
26+
# Fallback to the external path, if the other one isn't available.
27+
# This is the same behavior (try "internal", then check the LLVM_EXTERNAL_...
28+
# variable) as in add_llvm_external_project
29+
if(NOT EXISTS ${COMPILER_RT_SRC_ROOT})
30+
set(COMPILER_RT_SRC_ROOT ${LLVM_EXTERNAL_COMPILER_RT_SOURCE_DIR})
31+
endif()
32+
2633
if(LLVM_BUILD_EXTERNAL_COMPILER_RT AND EXISTS ${COMPILER_RT_SRC_ROOT}/)
2734
if(CMAKE_VERSION VERSION_GREATER 3.3.20150708)
2835
set(cmake_3_4_USES_TERMINAL_OPTIONS

0 commit comments

Comments
 (0)