[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / compiler-rt / lib / tsan / dd / CMakeLists.txt
bloba7359c573f142c35b15f33df19beb591073e2dbd
1 # Build for the experimental deadlock detector runtime library.
3 include_directories(../..)
5 set(DD_CFLAGS ${SANITIZER_COMMON_CFLAGS})
6 append_rtti_flag(OFF DD_CFLAGS)
8 set(DD_SOURCES
9   dd_rtl.cpp
10   dd_interceptors.cpp
11   )
13 set(DD_LINKLIBS
14   ${COMPILER_RT_UNWINDER_LINK_LIBS}
15   ${SANITIZER_CXX_ABI_LIBRARIES}
16   ${SANITIZER_COMMON_LINK_LIBS})
18 append_list_if(COMPILER_RT_HAS_LIBDL dl DD_LINKLIBS)
19 append_list_if(COMPILER_RT_HAS_LIBRT rt DD_LINKLIBS)
20 append_list_if(COMPILER_RT_HAS_LIBPTHREAD pthread DD_LINKLIBS)
22 add_custom_target(dd)
23 set_target_properties(dd PROPERTIES FOLDER "Compiler-RT Misc")
25 # Deadlock detector is currently supported on 64-bit Linux only.
26 if(CAN_TARGET_x86_64 AND UNIX AND NOT APPLE AND NOT ANDROID)
27   set(arch "x86_64")
28   add_compiler_rt_runtime(clang_rt.dd
29     STATIC
30     ARCHS ${arch}
31     SOURCES ${DD_SOURCES}
32             $<TARGET_OBJECTS:RTInterception.${arch}>
33             $<TARGET_OBJECTS:RTSanitizerCommon.${arch}>
34             $<TARGET_OBJECTS:RTSanitizerCommonLibc.${arch}>
35     CFLAGS ${DD_CFLAGS}
36     PARENT_TARGET dd)
38   add_compiler_rt_object_libraries(RTDD
39     ARCHS ${arch}
40     SOURCES ${DD_SOURCES} CFLAGS ${DD_CFLAGS})
42   add_compiler_rt_runtime(clang_rt.dyndd
43     SHARED
44     ARCHS ${arch}
45     SOURCES $<TARGET_OBJECTS:RTDD.${arch}>
46             $<TARGET_OBJECTS:RTInterception.${arch}>
47             $<TARGET_OBJECTS:RTSanitizerCommon.${arch}>
48             $<TARGET_OBJECTS:RTSanitizerCommonLibc.${arch}>
49             $<TARGET_OBJECTS:RTSanitizerCommonSymbolizer.${arch}>
50     LINK_FLAGS ${SANITIZER_COMMON_LINK_FLAGS}
51     LINK_LIBS ${DD_LINKLIBS}
52     PARENT_TARGET dd)
53 endif()
55 add_dependencies(compiler-rt dd)