Sergey Matveev | f484ff3 | 2013-05-20 11:13:33 +0000 | [diff] [blame] | 1 | include_directories(..) |
| 2 | |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 3 | set(LSAN_CFLAGS ${SANITIZER_COMMON_CFLAGS}) |
| 4 | append_no_rtti_flag(LSAN_CFLAGS) |
Sergey Matveev | f484ff3 | 2013-05-20 11:13:33 +0000 | [diff] [blame] | 5 | |
Sergey Matveev | 9bdf780 | 2013-05-21 14:12:11 +0000 | [diff] [blame] | 6 | set(LSAN_COMMON_SOURCES |
| 7 | lsan_common.cc |
| 8 | lsan_common_linux.cc) |
| 9 | |
Sergey Matveev | f484ff3 | 2013-05-20 11:13:33 +0000 | [diff] [blame] | 10 | set(LSAN_SOURCES |
Sergey Matveev | 74c8879 | 2013-11-25 17:39:36 +0000 | [diff] [blame] | 11 | lsan.cc |
Sergey Matveev | f484ff3 | 2013-05-20 11:13:33 +0000 | [diff] [blame] | 12 | lsan_allocator.cc |
Sergey Matveev | 74c8879 | 2013-11-25 17:39:36 +0000 | [diff] [blame] | 13 | lsan_interceptors.cc |
| 14 | lsan_preinit.cc |
| 15 | lsan_thread.cc) |
Sergey Matveev | f484ff3 | 2013-05-20 11:13:33 +0000 | [diff] [blame] | 16 | |
| 17 | set(LSAN_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}) |
| 18 | |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 19 | add_custom_target(lsan) |
Alexey Samsonov | 74799ca | 2013-05-20 14:16:45 +0000 | [diff] [blame] | 20 | |
Pirama Arumuga Nainar | cdce50b | 2015-07-01 12:26:56 -0700 | [diff] [blame] | 21 | add_compiler_rt_object_libraries(RTLSanCommon |
| 22 | OS ${SANITIZER_COMMON_SUPPORTED_OS} |
| 23 | ARCH ${LSAN_COMMON_SUPPORTED_ARCH} |
| 24 | SOURCES ${LSAN_COMMON_SOURCES} |
| 25 | CFLAGS ${LSAN_CFLAGS}) |
Sergey Matveev | 9bdf780 | 2013-05-21 14:12:11 +0000 | [diff] [blame] | 26 | |
Pirama Arumuga Nainar | cdce50b | 2015-07-01 12:26:56 -0700 | [diff] [blame] | 27 | if(NOT APPLE) |
Sergey Matveev | 9bdf780 | 2013-05-21 14:12:11 +0000 | [diff] [blame] | 28 | foreach(arch ${LSAN_SUPPORTED_ARCH}) |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 29 | add_compiler_rt_runtime(clang_rt.lsan-${arch} ${arch} STATIC |
Sergey Matveev | 9bdf780 | 2013-05-21 14:12:11 +0000 | [diff] [blame] | 30 | SOURCES ${LSAN_SOURCES} |
| 31 | $<TARGET_OBJECTS:RTInterception.${arch}> |
| 32 | $<TARGET_OBJECTS:RTSanitizerCommon.${arch}> |
| 33 | $<TARGET_OBJECTS:RTSanitizerCommonLibc.${arch}> |
| 34 | $<TARGET_OBJECTS:RTLSanCommon.${arch}> |
| 35 | CFLAGS ${LSAN_CFLAGS}) |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 36 | add_dependencies(lsan clang_rt.lsan-${arch}) |
Sergey Matveev | 9bdf780 | 2013-05-21 14:12:11 +0000 | [diff] [blame] | 37 | endforeach() |
Alexey Samsonov | 74799ca | 2013-05-20 14:16:45 +0000 | [diff] [blame] | 38 | endif() |
Sergey Matveev | f484ff3 | 2013-05-20 11:13:33 +0000 | [diff] [blame] | 39 | |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 40 | add_dependencies(compiler-rt lsan) |