[Clang][SME2] Enable multi-vector loads & stores for SME2 (#75821)
[llvm-project.git] / compiler-rt / lib / CMakeLists.txt
blob43ba9a102c848717fd14e5896dbd246617a518d9
1 # First, add the subdirectories which contain feature-based runtime libraries
2 # and several convenience helper libraries.
4 include(AddCompilerRT)
5 include(SanitizerUtils)
7 # Hoist the building of sanitizer_common on whether we're building either the
8 # sanitizers or xray (or both).
10 #TODO: Refactor sanitizer_common into smaller pieces (e.g. flag parsing, utils).
11 if (COMPILER_RT_HAS_SANITIZER_COMMON AND
12     (COMPILER_RT_BUILD_SANITIZERS OR COMPILER_RT_BUILD_XRAY OR COMPILER_RT_BUILD_MEMPROF))
13   add_subdirectory(sanitizer_common)
14 endif()
16 if(COMPILER_RT_BUILD_BUILTINS)
17   add_subdirectory(builtins)
18 endif()
20 function(compiler_rt_build_runtime runtime)
21   string(TOUPPER ${runtime} runtime_uppercase)
22   if(COMPILER_RT_HAS_${runtime_uppercase})
23     if(${runtime} STREQUAL tsan)
24       add_subdirectory(tsan/dd)
25     endif()
26     if(${runtime} STREQUAL scudo_standalone)
27       add_subdirectory(scudo/standalone)
28     else()
29       add_subdirectory(${runtime})
30     endif()
31   endif()
32 endfunction()
34 if(COMPILER_RT_BUILD_SANITIZERS OR COMPILER_RT_BUILD_MEMPROF)
35   compiler_rt_build_runtime(interception)
36 endif()
38 if(COMPILER_RT_BUILD_SANITIZERS)
39   if(COMPILER_RT_HAS_SANITIZER_COMMON)
40     add_subdirectory(stats)
41     add_subdirectory(lsan)
42     add_subdirectory(ubsan)
43   endif()
45   foreach(sanitizer ${COMPILER_RT_SANITIZERS_TO_BUILD})
46     compiler_rt_build_runtime(${sanitizer})
47   endforeach()
48 endif()
50 if(COMPILER_RT_BUILD_PROFILE AND COMPILER_RT_HAS_PROFILE)
51   compiler_rt_build_runtime(profile)
52 endif()
54 if(COMPILER_RT_BUILD_XRAY)
55   compiler_rt_build_runtime(xray)
56 endif()
58 if(COMPILER_RT_BUILD_LIBFUZZER)
59   compiler_rt_build_runtime(fuzzer)
60 endif()
62 if(COMPILER_RT_BUILD_MEMPROF AND COMPILER_RT_HAS_SANITIZER_COMMON)
63   compiler_rt_build_runtime(memprof)
64 endif()
66 if(COMPILER_RT_BUILD_ORC)
67   compiler_rt_build_runtime(orc)
68 endif()
70 # It doesn't normally make sense to build runtimes when a sanitizer is enabled,
71 # so we don't add_subdirectory the runtimes in that case. However, the opposite
72 # is true for fuzzers that exercise parts of the runtime. So we add the fuzzer
73 # directories explicitly here.
74 add_subdirectory(scudo/standalone/fuzz)