CMakeLists.txt revision 49496747758bf44163768ce3e07e40c8f95ccba9
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})
13
14if(APPLE)
15  # Build universal binary on APPLE.
16  foreach(os ${SANITIZER_COMMON_SUPPORTED_DARWIN_OS})
17    add_compiler_rt_darwin_object_library(RTInterception ${os}
18      ARCH ${SANITIZER_COMMON_SUPPORTED_ARCH}
19      SOURCES ${INTERCEPTION_SOURCES}
20      CFLAGS ${INTERCEPTION_CFLAGS})
21  endforeach()
22elseif(ANDROID)
23  add_library(RTInterception.arm.android OBJECT ${INTERCEPTION_SOURCES})
24  set_target_compile_flags(RTInterception.arm.android
25    ${INTERCEPTION_CFLAGS})
26else()
27  # Otherwise, build separate libraries for each target.
28  foreach(arch ${SANITIZER_COMMON_SUPPORTED_ARCH})
29    add_compiler_rt_object_library(RTInterception ${arch}
30      SOURCES ${INTERCEPTION_SOURCES} CFLAGS ${INTERCEPTION_CFLAGS})
31  endforeach()
32endif()
33