blob: 1c15d079dbb5b373f046bc6b645f4647b2a97e28 [file] [log] [blame]
Pirama Arumuga Nainarcdce50b2015-07-01 12:26:56 -07001add_custom_target(safestack)
2
3set(SAFESTACK_SOURCES safestack.cc)
4
5include_directories(..)
6
7set(SAFESTACK_CFLAGS ${SANITIZER_COMMON_CFLAGS})
8
9if(APPLE)
10 # Build universal binary on APPLE.
11 add_compiler_rt_osx_static_runtime(clang_rt.safestack_osx
12 ARCH ${SAFESTACK_SUPPORTED_ARCH}
13 SOURCES ${SAFESTACK_SOURCES}
14 $<TARGET_OBJECTS:RTInterception.osx>
15 $<TARGET_OBJECTS:RTSanitizerCommon.osx>
16 CFLAGS ${SAFESTACK_CFLAGS})
17 add_dependencies(safestack clang_rt.safestack_osx)
18else()
19 # Otherwise, build separate libraries for each target.
20 foreach(arch ${SAFESTACK_SUPPORTED_ARCH})
21 add_compiler_rt_runtime(clang_rt.safestack-${arch} ${arch} STATIC
22 SOURCES ${SAFESTACK_SOURCES}
23 $<TARGET_OBJECTS:RTInterception.${arch}>
24 $<TARGET_OBJECTS:RTSanitizerCommon.${arch}>
25 CFLAGS ${SAFESTACK_CFLAGS})
26 add_dependencies(safestack clang_rt.safestack-${arch})
27 endforeach()
28endif()