summaryrefslogtreecommitdiff
path: root/lib/scudo/CMakeLists.txt
blob: 332c3a972e6f3efbb72f6a8c613785f102c90930 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
add_compiler_rt_component(scudo)

include_directories(..)

set(SCUDO_CFLAGS ${SANITIZER_COMMON_CFLAGS})
append_rtti_flag(OFF SCUDO_CFLAGS)
append_list_if(COMPILER_RT_HAS_MSSE4_2_FLAG -msse4.2 SCUDO_CFLAGS)

set(SCUDO_SOURCES
  scudo_allocator.cpp
  scudo_flags.cpp
  scudo_interceptors.cpp
  scudo_new_delete.cpp
  scudo_termination.cpp
  scudo_utils.cpp)

if(COMPILER_RT_HAS_SCUDO)
  foreach(arch ${SCUDO_SUPPORTED_ARCH})
    add_compiler_rt_runtime(clang_rt.scudo
      STATIC
      ARCHS ${arch}
      SOURCES ${SCUDO_SOURCES}
              $<TARGET_OBJECTS:RTInterception.${arch}>
              $<TARGET_OBJECTS:RTSanitizerCommonNoTermination.${arch}>
              $<TARGET_OBJECTS:RTSanitizerCommonLibc.${arch}>
      CFLAGS ${SCUDO_CFLAGS}
      PARENT_TARGET scudo)
  endforeach()
endif()