Home | History | Annotate | Download | only in lsan
      1 include_directories(..)
      2 
      3 set(LSAN_CFLAGS ${SANITIZER_COMMON_CFLAGS})
      4 append_rtti_flag(OFF LSAN_CFLAGS)
      5 
      6 set(LSAN_COMMON_SOURCES
      7   lsan_common.cc
      8   lsan_common_linux.cc)
      9 
     10 set(LSAN_SOURCES
     11   lsan.cc
     12   lsan_allocator.cc
     13   lsan_interceptors.cc
     14   lsan_preinit.cc
     15   lsan_thread.cc)
     16 
     17 set(LSAN_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR})
     18 
     19 add_custom_target(lsan)
     20 set_target_properties(lsan PROPERTIES FOLDER "Compiler-RT Misc")
     21 
     22 add_compiler_rt_object_libraries(RTLSanCommon
     23     OS ${SANITIZER_COMMON_SUPPORTED_OS}
     24     ARCHS ${LSAN_COMMON_SUPPORTED_ARCH}
     25     SOURCES ${LSAN_COMMON_SOURCES}
     26     CFLAGS ${LSAN_CFLAGS})
     27 
     28 if(COMPILER_RT_HAS_LSAN)
     29   foreach(arch ${LSAN_SUPPORTED_ARCH})
     30     add_compiler_rt_runtime(clang_rt.lsan
     31       STATIC
     32       ARCHS ${arch}
     33       SOURCES ${LSAN_SOURCES}
     34               $<TARGET_OBJECTS:RTInterception.${arch}>
     35               $<TARGET_OBJECTS:RTSanitizerCommon.${arch}>
     36               $<TARGET_OBJECTS:RTSanitizerCommonLibc.${arch}>
     37               $<TARGET_OBJECTS:RTLSanCommon.${arch}>
     38       CFLAGS ${LSAN_CFLAGS}
     39       PARENT_TARGET lsan)
     40   endforeach()
     41 endif()
     42 
     43 add_dependencies(compiler-rt lsan)
     44