Home | History | Annotate | Download | only in lib
      1 # First, add the subdirectories which contain feature-based runtime libraries
      2 # and several convenience helper libraries.
      3 
      4 include(AddCompilerRT)
      5 include(SanitizerUtils)
      6 # Don't build sanitizers in the bootstrap build.
      7 if(NOT LLVM_USE_SANITIZER)
      8   # AddressSanitizer is supported on Linux, FreeBSD and Mac OS X.
      9   # 32-bit Windows support is experimental.
     10   if(CMAKE_SYSTEM_NAME MATCHES "Darwin|Linux|FreeBSD")
     11     set(SUPPORTS_BUILDING_ASAN TRUE)
     12   elseif(CMAKE_SYSTEM_NAME MATCHES "Windows"
     13          AND MSVC AND CMAKE_SIZEOF_VOID_P EQUAL 4)
     14     set(SUPPORTS_BUILDING_ASAN TRUE)
     15   else()
     16     set(SUPPORTS_BUILDING_ASAN FALSE)
     17   endif()
     18   if(SUPPORTS_BUILDING_ASAN)
     19     add_subdirectory(asan)
     20     add_subdirectory(interception)
     21     add_subdirectory(sanitizer_common)
     22   endif()
     23   if(CMAKE_SYSTEM_NAME MATCHES "Darwin|Linux|FreeBSD" AND NOT ANDROID)
     24     # LSan, UBsan and profile can be built on Mac OS, FreeBSD and Linux.
     25     add_subdirectory(lsan)
     26     add_subdirectory(profile)
     27     add_subdirectory(ubsan)
     28   endif()
     29   if(CMAKE_SYSTEM_NAME MATCHES "Linux" AND NOT ANDROID)
     30     # ThreadSanitizer and MemorySanitizer are supported on Linux only.
     31     add_subdirectory(tsan)
     32     add_subdirectory(tsan/dd)
     33     add_subdirectory(msan)
     34     add_subdirectory(msandr)
     35     add_subdirectory(dfsan)
     36   endif()
     37 endif()
     38 
     39 add_subdirectory(builtins)
     40