Pirama Arumuga Nainar | cdce50b | 2015-07-01 12:26:56 -0700 | [diff] [blame] | 1 | add_custom_target(safestack) |
| 2 | |
| 3 | set(SAFESTACK_SOURCES safestack.cc) |
| 4 | |
| 5 | include_directories(..) |
| 6 | |
| 7 | set(SAFESTACK_CFLAGS ${SANITIZER_COMMON_CFLAGS}) |
| 8 | |
| 9 | if(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) |
| 18 | else() |
| 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() |
| 28 | endif() |