blob: d3f3f24fb7ca47f76d0b9537d7f070a092cc82ae (
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
# Build system for the common Sanitizer runtime support library components.
# These components are shared between AddressSanitizer and ThreadSanitizer.
set(SANITIZER_SOURCES
sanitizer_allocator.cc
sanitizer_common.cc
sanitizer_flags.cc
sanitizer_libc.cc
sanitizer_linux.cc
sanitizer_mac.cc
sanitizer_posix.cc
sanitizer_printf.cc
sanitizer_symbolizer.cc
sanitizer_symbolizer_llvm.cc
sanitizer_win.cc
)
set(SANITIZER_CFLAGS
-O3
-fPIC
-fno-exceptions
-funwind-tables
-fvisibility=hidden
)
if(APPLE)
# Build universal binary on APPLE.
add_library(RTSanitizerCommon.osx OBJECT ${SANITIZER_SOURCES})
set_target_compile_flags(RTSanitizerCommon.osx ${SANITIZER_CFLAGS})
filter_available_targets(SANITIZER_TARGETS x86_64 i386)
set_target_properties(RTSanitizerCommon.osx PROPERTIES
OSX_ARCHITECTURES "${SANITIZER_TARGETS}")
else()
# Otherwise, build separate libraries for each target.
if(CAN_TARGET_X86_64)
add_library(RTSanitizerCommon.x86_64 OBJECT ${SANITIZER_SOURCES})
set_target_compile_flags(RTSanitizerCommon.x86_64
${SANITIZER_CFLAGS} ${TARGET_X86_64_CFLAGS})
endif()
if(CAN_TARGET_I386)
add_library(RTSanitizerCommon.i386 OBJECT ${SANITIZER_SOURCES})
set_target_compile_flags(RTSanitizerCommon.i386
${SANITIZER_CFLAGS} ${TARGET_I386_CFLAGS})
endif()
endif()
# FIXME: Add support for running sanitizer_common unit tests.
|