2012-06-25 16:40:10 +08:00
|
|
|
# First, add the subdirectories which contain feature-based runtime libraries
|
|
|
|
# and several convenience helper libraries.
|
2013-09-02 16:57:23 +08:00
|
|
|
|
2014-02-18 15:26:58 +08:00
|
|
|
include(AddCompilerRT)
|
|
|
|
include(SanitizerUtils)
|
2013-09-02 16:57:23 +08:00
|
|
|
# Don't build sanitizers in the bootstrap build.
|
2014-02-19 15:49:16 +08:00
|
|
|
if(NOT LLVM_USE_SANITIZER)
|
2014-04-10 02:45:12 +08:00
|
|
|
# AddressSanitizer is supported on Linux, FreeBSD and Mac OS X.
|
2013-11-17 18:12:23 +08:00
|
|
|
# 32-bit Windows support is experimental.
|
2014-04-10 02:45:12 +08:00
|
|
|
if(CMAKE_SYSTEM_NAME MATCHES "Darwin|Linux|FreeBSD")
|
2013-11-17 18:12:23 +08:00
|
|
|
set(SUPPORTS_BUILDING_ASAN TRUE)
|
2013-11-17 20:18:35 +08:00
|
|
|
elseif(CMAKE_SYSTEM_NAME MATCHES "Windows"
|
|
|
|
AND MSVC AND CMAKE_SIZEOF_VOID_P EQUAL 4)
|
2013-11-17 18:12:23 +08:00
|
|
|
set(SUPPORTS_BUILDING_ASAN TRUE)
|
|
|
|
else()
|
|
|
|
set(SUPPORTS_BUILDING_ASAN FALSE)
|
|
|
|
endif()
|
|
|
|
if(SUPPORTS_BUILDING_ASAN)
|
2013-09-02 16:57:23 +08:00
|
|
|
add_subdirectory(asan)
|
|
|
|
add_subdirectory(interception)
|
|
|
|
add_subdirectory(sanitizer_common)
|
|
|
|
endif()
|
2014-04-10 02:45:12 +08:00
|
|
|
if(CMAKE_SYSTEM_NAME MATCHES "Darwin|Linux|FreeBSD" AND NOT ANDROID)
|
|
|
|
# LSan, UBsan and profile can be built on Mac OS, FreeBSD and Linux.
|
2013-11-17 18:12:23 +08:00
|
|
|
add_subdirectory(lsan)
|
|
|
|
add_subdirectory(profile)
|
|
|
|
add_subdirectory(ubsan)
|
|
|
|
endif()
|
|
|
|
if(CMAKE_SYSTEM_NAME MATCHES "Linux" AND NOT ANDROID)
|
2013-09-02 16:57:23 +08:00
|
|
|
# ThreadSanitizer and MemorySanitizer are supported on Linux only.
|
|
|
|
add_subdirectory(tsan)
|
2014-03-03 21:15:12 +08:00
|
|
|
add_subdirectory(tsan/dd)
|
2013-09-02 16:57:23 +08:00
|
|
|
add_subdirectory(msan)
|
|
|
|
add_subdirectory(msandr)
|
|
|
|
add_subdirectory(dfsan)
|
2013-01-19 01:03:47 +08:00
|
|
|
endif()
|
2012-09-19 21:11:13 +08:00
|
|
|
endif()
|
2012-06-23 05:09:10 +08:00
|
|
|
|
2014-02-14 17:20:33 +08:00
|
|
|
add_subdirectory(builtins)
|