Revert "Revert "[CMake] LSan is not actually available on Darwin.""

Re-land fixed version of r239955.

llvm-svn: 240108
This commit is contained in:
Alexey Samsonov 2015-06-19 01:34:06 +00:00
parent 9a10674079
commit 2a567835d1
3 changed files with 10 additions and 12 deletions

View File

@ -295,7 +295,7 @@ else()
endif()
if (COMPILER_RT_HAS_SANITIZER_COMMON AND LSAN_SUPPORTED_ARCH AND
OS_NAME MATCHES "Darwin|Linux|FreeBSD")
OS_NAME MATCHES "Linux|FreeBSD")
set(COMPILER_RT_HAS_LSAN TRUE)
else()
set(COMPILER_RT_HAS_LSAN FALSE)

View File

@ -24,7 +24,7 @@ add_compiler_rt_object_libraries(RTLSanCommon
SOURCES ${LSAN_COMMON_SOURCES}
CFLAGS ${LSAN_CFLAGS})
if(NOT APPLE)
if(COMPILER_RT_HAS_LSAN)
foreach(arch ${LSAN_SUPPORTED_ARCH})
add_compiler_rt_runtime(clang_rt.lsan-${arch} ${arch} STATIC
SOURCES ${LSAN_SOURCES}

View File

@ -10,14 +10,12 @@ configure_lit_site_cfg(
${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
${CMAKE_CURRENT_BINARY_DIR}/AsanConfig/lit.site.cfg)
if(NOT APPLE AND NOT ANDROID)
set(LSAN_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS})
if(NOT COMPILER_RT_STANDALONE_BUILD)
list(APPEND LSAN_TEST_DEPS lsan asan)
endif()
add_lit_testsuite(check-lsan "Running the LeakSanitizer tests"
${CMAKE_CURRENT_BINARY_DIR}/LsanConfig
${CMAKE_CURRENT_BINARY_DIR}/AsanConfig
DEPENDS ${LSAN_TEST_DEPS})
set_target_properties(check-lsan PROPERTIES FOLDER "LSan tests")
set(LSAN_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS})
if(NOT COMPILER_RT_STANDALONE_BUILD)
list(APPEND LSAN_TEST_DEPS lsan asan)
endif()
add_lit_testsuite(check-lsan "Running the LeakSanitizer tests"
${CMAKE_CURRENT_BINARY_DIR}/LsanConfig
${CMAKE_CURRENT_BINARY_DIR}/AsanConfig
DEPENDS ${LSAN_TEST_DEPS})
set_target_properties(check-lsan PROPERTIES FOLDER "LSan tests")