diff options
author | Alexey Samsonov <samsonov@google.com> | 2013-11-17 10:12:23 +0000 |
---|---|---|
committer | Alexey Samsonov <samsonov@google.com> | 2013-11-17 10:12:23 +0000 |
commit | 3125de9e3048bc505344053d3518cccab7ee6897 (patch) | |
tree | 984a49de14cbcd08911189192dcc4a72e423297d | |
parent | c85d6274d127d988539ed6a35242d3f82c4eb5bf (diff) | |
download | compiler-rt-3125de9e3048bc505344053d3518cccab7ee6897.tar.gz |
CMake: don't build sanitizer runtimes on 64-bit Windows (it's unsupported for now)
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@194958 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/CMakeLists.txt | 26 | ||||
-rw-r--r-- | lib/asan/CMakeLists.txt | 2 |
2 files changed, 18 insertions, 10 deletions
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 8b382c140..d4624a692 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -3,19 +3,27 @@ # Don't build sanitizers in the bootstrap build. if(LLVM_USE_SANITIZER STREQUAL "") - if(CMAKE_SYSTEM_NAME MATCHES "Darwin|Linux|Windows") - # AddressSanitizer is supported on Linux and Mac OS X. - # Windows support is experimental. + # AddressSanitizer is supported on Linux and Mac OS X. + # 32-bit Windows support is experimental. + if(CMAKE_SYSTEM_NAME MATCHES "Darwin|Linux") + set(SUPPORTS_BUILDING_ASAN TRUE) + elseif(CMAKE_SYSTEM_NAME MATCHES "Windows" AND CMAKE_SIZEOF_VOID_P EQUAL 4) + set(SUPPORTS_BUILDING_ASAN TRUE) + else() + set(SUPPORTS_BUILDING_ASAN FALSE) + endif() + if(SUPPORTS_BUILDING_ASAN) add_subdirectory(asan) add_subdirectory(interception) add_subdirectory(sanitizer_common) - if(NOT ANDROID AND NOT WIN32) - add_subdirectory(lsan) - add_subdirectory(profile) - add_subdirectory(ubsan) - endif() endif() - if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux" AND NOT ANDROID) + if(CMAKE_SYSTEM_NAME MATCHES "Darwin|Linux" AND NOT ANDROID) + # LSan, UBsan and profile can be built on Mac OS and Linux. + add_subdirectory(lsan) + add_subdirectory(profile) + add_subdirectory(ubsan) + endif() + if(CMAKE_SYSTEM_NAME MATCHES "Linux" AND NOT ANDROID) # ThreadSanitizer and MemorySanitizer are supported on Linux only. add_subdirectory(tsan) add_subdirectory(msan) diff --git a/lib/asan/CMakeLists.txt b/lib/asan/CMakeLists.txt index fc3a73efa..ad3f05488 100644 --- a/lib/asan/CMakeLists.txt +++ b/lib/asan/CMakeLists.txt @@ -116,7 +116,7 @@ else() $<TARGET_OBJECTS:RTInterception.${arch}> $<TARGET_OBJECTS:RTSanitizerCommon.${arch}> $<TARGET_OBJECTS:RTSanitizerCommonLibc.${arch}>) - if (NOT MSVC) + if (NOT WIN32) # We can't build Leak Sanitizer on Windows yet. list(APPEND ASAN_RUNTIME_OBJECTS $<TARGET_OBJECTS:RTLSanCommon.${arch}>) endif() |