1# Build for the runtime interception helper library.
2
3set(INTERCEPTION_SOURCES
4  interception_linux.cc
5  interception_mac.cc
6  interception_win.cc
7  interception_type_test.cc
8  )
9
10include_directories(..)
11
12set(INTERCEPTION_CFLAGS ${SANITIZER_COMMON_CFLAGS})
13append_no_rtti_flag(INTERCEPTION_CFLAGS)
14
15if(APPLE)
16  # Build universal binary on APPLE.
17  foreach(os ${SANITIZER_COMMON_SUPPORTED_DARWIN_OS})
18    add_compiler_rt_darwin_object_library(RTInterception ${os}
19      ARCH ${SANITIZER_COMMON_SUPPORTED_ARCH}
20      SOURCES ${INTERCEPTION_SOURCES}
21      CFLAGS ${INTERCEPTION_CFLAGS})
22  endforeach()
23elseif(ANDROID)
24  add_library(RTInterception.arm.android OBJECT ${INTERCEPTION_SOURCES})
25  set_target_compile_flags(RTInterception.arm.android
26    ${INTERCEPTION_CFLAGS})
27else()
28  # Otherwise, build separate libraries for each target.
29  foreach(arch ${SANITIZER_COMMON_SUPPORTED_ARCH})
30    add_compiler_rt_object_library(RTInterception ${arch}
31      SOURCES ${INTERCEPTION_SOURCES} CFLAGS ${INTERCEPTION_CFLAGS})
32  endforeach()
33endif()
34