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
|
|
|
|
2013-06-23 00:33:52 +08:00
|
|
|
if(APPLE)
|
2013-11-07 18:08:19 +08:00
|
|
|
foreach(os ${SANITIZER_COMMON_SUPPORTED_DARWIN_OS})
|
|
|
|
add_compiler_rt_darwin_object_library(RTLSanCommon ${os}
|
|
|
|
ARCH ${LSAN_COMMON_SUPPORTED_ARCH}
|
|
|
|
SOURCES ${LSAN_COMMON_SOURCES}
|
|
|
|
CFLAGS ${LSAN_CFLAGS})
|
|
|
|
endforeach()
|
2014-09-29 21:18:55 +08:00
|
|
|
else()
|
2013-05-21 22:12:11 +08:00
|
|
|
foreach(arch ${LSAN_COMMON_SUPPORTED_ARCH})
|
|
|
|
add_compiler_rt_object_library(RTLSanCommon ${arch}
|
|
|
|
SOURCES ${LSAN_COMMON_SOURCES}
|
|
|
|
CFLAGS ${LSAN_CFLAGS})
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
foreach(arch ${LSAN_SUPPORTED_ARCH})
|
2014-03-31 21:45:36 +08:00
|
|
|
add_compiler_rt_runtime(clang_rt.lsan-${arch} ${arch} STATIC
|
2013-05-21 22:12:11 +08:00
|
|
|
SOURCES ${LSAN_SOURCES}
|
|
|
|
$<TARGET_OBJECTS:RTInterception.${arch}>
|
|
|
|
$<TARGET_OBJECTS:RTSanitizerCommon.${arch}>
|
|
|
|
$<TARGET_OBJECTS:RTSanitizerCommonLibc.${arch}>
|
|
|
|
$<TARGET_OBJECTS:RTLSanCommon.${arch}>
|
|
|
|
CFLAGS ${LSAN_CFLAGS})
|
2014-02-14 20:26:05 +08:00
|
|
|
add_dependencies(lsan clang_rt.lsan-${arch})
|
2013-05-21 22:12:11 +08:00
|
|
|
endforeach()
|
2013-05-20 22:16:45 +08:00
|
|
|
endif()
|
2014-02-18 17:33:45 +08:00
|
|
|
|
|
|
|
add_dependencies(compiler-rt lsan)
|