]>
Commit | Line | Data |
---|---|---|
1a4d82fc JJ |
1 | # First, add the subdirectories which contain feature-based runtime libraries |
2 | # and several convenience helper libraries. | |
3 | ||
4 | include(AddCompilerRT) | |
5 | include(SanitizerUtils) | |
92a42be0 | 6 | |
7cac9316 XL |
7 | # Hoist the building of sanitizer_common on whether we're building either the |
8 | # sanitizers or xray (or both). | |
9 | # | |
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)) | |
13 | add_subdirectory(sanitizer_common) | |
14 | endif() | |
15 | ||
92a42be0 SL |
16 | if(COMPILER_RT_BUILD_BUILTINS) |
17 | add_subdirectory(builtins) | |
18 | endif() | |
19 | ||
7cac9316 XL |
20 | function(compiler_rt_build_runtime runtime) |
21 | string(TOUPPER ${runtime} runtime_uppercase) | |
22 | if(COMPILER_RT_HAS_${runtime_uppercase}) | |
23 | add_subdirectory(${runtime}) | |
2c00a5a8 XL |
24 | if(${runtime} STREQUAL tsan) |
25 | add_subdirectory(tsan/dd) | |
26 | endif() | |
7cac9316 XL |
27 | endif() |
28 | endfunction() | |
29 | ||
30 | if(COMPILER_RT_BUILD_SANITIZERS) | |
31 | compiler_rt_build_runtime(interception) | |
92a42be0 SL |
32 | |
33 | if(COMPILER_RT_HAS_SANITIZER_COMMON) | |
5bcae85e | 34 | add_subdirectory(stats) |
1a4d82fc | 35 | add_subdirectory(lsan) |
1a4d82fc JJ |
36 | add_subdirectory(ubsan) |
37 | endif() | |
92a42be0 | 38 | |
2c00a5a8 XL |
39 | foreach(sanitizer ${COMPILER_RT_SANITIZERS_TO_BUILD}) |
40 | compiler_rt_build_runtime(${sanitizer}) | |
41 | endforeach() | |
42 | endif() | |
92a42be0 | 43 | |
2c00a5a8 | 44 | if(COMPILER_RT_BUILD_PROFILE AND COMPILER_RT_HAS_PROFILE) |
7cac9316 XL |
45 | compiler_rt_build_runtime(profile) |
46 | endif() | |
5bcae85e | 47 | |
7cac9316 XL |
48 | if(COMPILER_RT_BUILD_XRAY) |
49 | compiler_rt_build_runtime(xray) | |
92a42be0 | 50 | endif() |
2c00a5a8 XL |
51 | |
52 | if(COMPILER_RT_BUILD_LIBFUZZER) | |
53 | compiler_rt_build_runtime(fuzzer) | |
54 | endif() |