2013-05-20 19:13:33 +08:00
|
|
|
include_directories(..)
|
|
|
|
|
2014-02-18 15:52:40 +08:00
|
|
|
set(LSAN_CFLAGS ${SANITIZER_COMMON_CFLAGS})
|
|
|
|
append_no_rtti_flag(LSAN_CFLAGS)
|
2013-05-20 19:13:33 +08:00
|
|
|
|
2013-05-21 22:12:11 +08:00
|
|
|
set(LSAN_COMMON_SOURCES
|
|
|
|
lsan_common.cc
|
|
|
|
lsan_common_linux.cc)
|
|
|
|
|
2013-05-20 19:13:33 +08:00
|
|
|
set(LSAN_SOURCES
|
2013-11-25 22:25:36 +08:00
|
|
|
lsan.cc
|
2013-05-20 19:13:33 +08:00
|
|
|
lsan_allocator.cc
|
2013-11-25 22:25:36 +08:00
|
|
|
lsan_interceptors.cc
|
|
|
|
lsan_preinit.cc
|
|
|
|
lsan_thread.cc)
|
2013-05-20 19:13:33 +08:00
|
|
|
|
|
|
|
set(LSAN_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR})
|
|
|
|
|
2014-02-14 20:26:05 +08:00
|
|
|
add_custom_target(lsan)
|
2013-05-20 22:16:45 +08:00
|
|
|
|
2015-06-11 07:55:07 +08:00
|
|
|
add_compiler_rt_object_libraries(RTLSanCommon
|
|
|
|
OS ${SANITIZER_COMMON_SUPPORTED_OS}
|
2015-06-19 11:39:24 +08:00
|
|
|
ARCHS ${LSAN_COMMON_SUPPORTED_ARCH}
|
2015-06-11 07:55:07 +08:00
|
|
|
SOURCES ${LSAN_COMMON_SOURCES}
|
|
|
|
CFLAGS ${LSAN_CFLAGS})
|
2013-05-21 22:12:11 +08:00
|
|
|
|
2015-06-19 09:34:06 +08:00
|
|
|
if(COMPILER_RT_HAS_LSAN)
|
2015-06-18 11:39:51 +08:00
|
|
|
foreach(arch ${LSAN_SUPPORTED_ARCH})
|
2015-08-26 03:53:09 +08:00
|
|
|
add_compiler_rt_runtime(clang_rt.lsan
|
|
|
|
STATIC
|
|
|
|
ARCHS ${arch}
|
2015-06-18 11:39:51 +08:00
|
|
|
SOURCES ${LSAN_SOURCES}
|
|
|
|
$<TARGET_OBJECTS:RTInterception.${arch}>
|
|
|
|
$<TARGET_OBJECTS:RTSanitizerCommon.${arch}>
|
|
|
|
$<TARGET_OBJECTS:RTSanitizerCommonLibc.${arch}>
|
|
|
|
$<TARGET_OBJECTS:RTLSanCommon.${arch}>
|
2015-08-26 03:53:09 +08:00
|
|
|
CFLAGS ${LSAN_CFLAGS}
|
|
|
|
PARENT_TARGET lsan)
|
2015-06-18 11:39:51 +08:00
|
|
|
endforeach()
|
|
|
|
endif()
|
2014-02-18 17:33:45 +08:00
|
|
|
|
|
|
|
add_dependencies(compiler-rt lsan)
|