llvm.org GIT mirror llvm / 3449d54
[CMake] Ensure that compiler-rt is added first This will enable other runtime projects to detect the presence of sanitizer runtimes by referring to the sanitizer targets directly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280162 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Bieneman 4 years ago
1 changed file(s) with 15 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
3131 "${CMAKE_CURRENT_SOURCE_DIR}/../cmake/Modules"
3232 "${LLVM_BINARY_DIR}/lib/cmake/llvm"
3333 )
35 # Some of the runtimes will conditionally use the compiler-rt sanitizers
36 # to make this work smoothly we ensure that compiler-rt is added first in
37 # the list of sub-projects. This allows other sub-projects to have checks
38 # like `if(TARGET asan)` to enable building with asan.
39 foreach(entry ${runtimes})
40 if("${entry}" MATCHES "compiler-rt")
41 set(compiler_rt_path ${entry})
42 break()
43 endif()
44 endforeach()
45 if(compiler_rt_path)
46 list(REMOVE_ITEM runtimes ${compiler_rt_path})
47 list(INSERT runtimes 0 ${compiler_rt_path})
48 endif()
3550 # LLVMConfig.cmake contains a bunch of CMake variables from the LLVM build.
3651 # This file is installed as part of LLVM distributions, so this can be used