1 # First, add the subdirectories which contain feature-based runtime libraries
2 # and several convenience helper libraries.
4 # Don't build sanitizers in the bootstrap build.
5 if(LLVM_USE_SANITIZER STREQUAL "")
6 # AddressSanitizer is supported on Linux and Mac OS X.
7 # 32-bit Windows support is experimental.
8 if(CMAKE_SYSTEM_NAME MATCHES "Darwin|Linux")
9 set(SUPPORTS_BUILDING_ASAN TRUE)
10 elseif(CMAKE_SYSTEM_NAME MATCHES "Windows"
11 AND MSVC AND CMAKE_SIZEOF_VOID_P EQUAL 4)
12 set(SUPPORTS_BUILDING_ASAN TRUE)
14 set(SUPPORTS_BUILDING_ASAN FALSE)
16 if(SUPPORTS_BUILDING_ASAN)
17 add_subdirectory(asan)
18 add_subdirectory(interception)
19 add_subdirectory(sanitizer_common)
21 if(CMAKE_SYSTEM_NAME MATCHES "Darwin|Linux" AND NOT ANDROID)
22 # LSan, UBsan and profile can be built on Mac OS and Linux.
23 add_subdirectory(lsan)
24 add_subdirectory(profile)
25 add_subdirectory(ubsan)
27 if(CMAKE_SYSTEM_NAME MATCHES "Linux" AND NOT ANDROID)
28 # ThreadSanitizer and MemorySanitizer are supported on Linux only.
29 add_subdirectory(tsan)
30 add_subdirectory(msan)
31 add_subdirectory(msandr)
32 add_subdirectory(dfsan)
36 # The top-level lib directory contains a large amount of C code which provides
37 # generic implementations of the core runtime library along with optimized
38 # architecture-specific code in various subdirectories.
54 # FIXME: atomic.c may only be compiled if host compiler understands _Atomic
77 enable_execute_stack.c
199 foreach(arch x86_64 i386)
200 if(CAN_TARGET_${arch})
201 add_compiler_rt_static_runtime(clang_rt.${arch} ${arch}
202 SOURCES ${${arch}_SOURCES}
208 # Generate configs for running lit and unit tests.
209 configure_lit_site_cfg(
210 ${CMAKE_CURRENT_SOURCE_DIR}/lit.common.configured.in
211 ${CMAKE_CURRENT_BINARY_DIR}/lit.common.configured)
213 configure_lit_site_cfg(
214 ${CMAKE_CURRENT_SOURCE_DIR}/lit.common.unit.configured.in
215 ${CMAKE_CURRENT_BINARY_DIR}/lit.common.unit.configured)