[AArch64] Fix SDNode type mismatches between *.td files and ISel (#116523)
[llvm-project.git] / compiler-rt / lib / lsan / CMakeLists.txt
blobcece6238a790195845e2f44d038939a12aca6569
1 include_directories(..)
3 set(LSAN_CFLAGS ${SANITIZER_COMMON_CFLAGS})
4 append_rtti_flag(OFF LSAN_CFLAGS)
6 # Too many existing bugs, needs cleanup.
7 append_list_if(COMPILER_RT_HAS_WNO_FORMAT -Wno-format LSAN_CFLAGS)
9 set(LSAN_COMMON_SOURCES
10   lsan_common.cpp
11   lsan_common_fuchsia.cpp
12   lsan_common_linux.cpp
13   lsan_common_mac.cpp
14   )
16 set(LSAN_SOURCES
17   lsan.cpp
18   lsan_allocator.cpp
19   lsan_fuchsia.cpp
20   lsan_interceptors.cpp
21   lsan_linux.cpp
22   lsan_mac.cpp
23   lsan_malloc_mac.cpp
24   lsan_posix.cpp
25   lsan_preinit.cpp
26   lsan_thread.cpp
27   )
29 set(LSAN_HEADERS
30   lsan.h
31   lsan_allocator.h
32   lsan_common.h
33   lsan_flags.inc
34   lsan_thread.h
35   )
37 set(LSAN_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR})
39 # Used by asan/hwasan even without COMPILER_RT_HAS_LSAN.
40 add_compiler_rt_object_libraries(RTLSanCommon
41     OS ${SANITIZER_COMMON_SUPPORTED_OS}
42     ARCHS ${LSAN_COMMON_SUPPORTED_ARCH}
43     SOURCES ${LSAN_COMMON_SOURCES}
44     ADDITIONAL_HEADERS ${LSAN_HEADERS}
45     CFLAGS ${LSAN_CFLAGS})
47 if(COMPILER_RT_HAS_LSAN)
48   add_compiler_rt_component(lsan)
49   if(APPLE)
50     set(LSAN_LINK_LIBS ${SANITIZER_COMMON_LINK_LIBS})
52     add_weak_symbols("lsan" WEAK_SYMBOL_LINK_FLAGS)
53     add_weak_symbols("sanitizer_common" WEAK_SYMBOL_LINK_FLAGS)
55     add_compiler_rt_runtime(clang_rt.lsan
56       SHARED
57       OS ${LSAN_SUPPORTED_OS}
58       ARCHS ${LSAN_SUPPORTED_ARCH}
59       SOURCES ${LSAN_SOURCES}
60       ADDITIONAL_HEADERS ${LSAN_HEADERS}
61       OBJECT_LIBS RTLSanCommon
62                   RTInterception
63                   RTSanitizerCommon
64                   RTSanitizerCommonLibc
65                   RTSanitizerCommonCoverage
66                   RTSanitizerCommonSymbolizer
67       CFLAGS ${LSAN_CFLAGS}
68       LINK_FLAGS ${SANITIZER_COMMON_LINK_FLAGS} ${WEAK_SYMBOL_LINK_FLAGS}
69       LINK_LIBS ${LSAN_LINK_LIBS}
70       PARENT_TARGET lsan)
71   else()
72     foreach(arch ${LSAN_SUPPORTED_ARCH})
73       add_compiler_rt_runtime(clang_rt.lsan
74         STATIC
75         ARCHS ${arch}
76         SOURCES ${LSAN_SOURCES}
77                 $<TARGET_OBJECTS:RTInterception.${arch}>
78                 $<TARGET_OBJECTS:RTSanitizerCommon.${arch}>
79                 $<TARGET_OBJECTS:RTSanitizerCommonLibc.${arch}>
80                 $<TARGET_OBJECTS:RTSanitizerCommonCoverage.${arch}>
81                 $<TARGET_OBJECTS:RTSanitizerCommonSymbolizer.${arch}>
82                 $<TARGET_OBJECTS:RTSanitizerCommonSymbolizerInternal.${arch}>
83                 $<TARGET_OBJECTS:RTLSanCommon.${arch}>
84         ADDITIONAL_HEADERS ${LSAN_HEADERS}
85         CFLAGS ${LSAN_CFLAGS}
86         PARENT_TARGET lsan)
87     endforeach()
88   endif()
89 endif()