blob: 7a060e858dbc7597b5505cd4894281ee3afbb0e7 [file] [log] [blame]
Dmitry Vyukov530fb942014-03-03 13:15:12 +00001# Build for the experimental deadlock detector runtime library.
2
3include_directories(../..)
4
5set(DD_CFLAGS ${SANITIZER_COMMON_CFLAGS})
6append_no_rtti_flag(DD_CFLAGS)
7
8if("${CMAKE_BUILD_TYPE}" EQUAL "Release")
9 set(DD_COMMON_DEFINITIONS DEBUG=0)
10else()
11 set(DD_COMMON_DEFINITIONS DEBUG=1)
12endif()
13
14set(DD_SOURCES
15 dd_rtl.cc
16 dd_interceptors.cc
17)
18
19set(DD_HEADERS
20 dd_rtl.h
21)
22
23add_custom_target(dd)
24# Deadlock detector is currently supported on 64-bit Linux only.
25if(CAN_TARGET_x86_64 AND UNIX AND NOT APPLE)
26 set(arch "x86_64")
27 add_compiler_rt_static_runtime(clang_rt.dd-${arch} ${arch}
28 SOURCES ${DD_SOURCES}
29 $<TARGET_OBJECTS:RTInterception.${arch}>
30 $<TARGET_OBJECTS:RTSanitizerCommon.${arch}>
31 $<TARGET_OBJECTS:RTSanitizerCommonLibc.${arch}>
32 CFLAGS ${DD_CFLAGS}
33 DEFS ${DD_COMMON_DEFINITIONS})
34endif()
35
36add_dependencies(compiler-rt dd)
37