Peter Collingbourne | b64d0b1 | 2015-06-15 21:08:47 +0000 | [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. |
Chris Bieneman | d160260 | 2015-08-25 19:53:09 +0000 | [diff] [blame] | 11 | add_compiler_rt_runtime(clang_rt.safestack |
| 12 | STATIC |
| 13 | OS osx |
| 14 | ARCHS ${SAFESTACK_SUPPORTED_ARCH} |
| 15 | SOURCES ${SAFESTACK_SOURCES} |
| 16 | $<TARGET_OBJECTS:RTInterception.osx> |
| 17 | $<TARGET_OBJECTS:RTSanitizerCommon.osx> |
Alexey Samsonov | ee03b5b | 2015-08-27 22:23:27 +0000 | [diff] [blame] | 18 | $<TARGET_OBJECTS:RTSanitizerCommonNoLibc.osx> |
Chris Bieneman | d160260 | 2015-08-25 19:53:09 +0000 | [diff] [blame] | 19 | CFLAGS ${SAFESTACK_CFLAGS} |
| 20 | PARENT_TARGET safestack) |
Peter Collingbourne | b64d0b1 | 2015-06-15 21:08:47 +0000 | [diff] [blame] | 21 | else() |
| 22 | # Otherwise, build separate libraries for each target. |
| 23 | foreach(arch ${SAFESTACK_SUPPORTED_ARCH}) |
Chris Bieneman | d160260 | 2015-08-25 19:53:09 +0000 | [diff] [blame] | 24 | add_compiler_rt_runtime(clang_rt.safestack |
| 25 | STATIC |
| 26 | ARCHS ${arch} |
Peter Collingbourne | b64d0b1 | 2015-06-15 21:08:47 +0000 | [diff] [blame] | 27 | SOURCES ${SAFESTACK_SOURCES} |
| 28 | $<TARGET_OBJECTS:RTInterception.${arch}> |
| 29 | $<TARGET_OBJECTS:RTSanitizerCommon.${arch}> |
Evgeniy Stepanov | 5a268b1 | 2015-07-23 22:05:20 +0000 | [diff] [blame] | 30 | $<TARGET_OBJECTS:RTSanitizerCommonNoLibc.${arch}> |
Chris Bieneman | d160260 | 2015-08-25 19:53:09 +0000 | [diff] [blame] | 31 | CFLAGS ${SAFESTACK_CFLAGS} |
| 32 | PARENT_TARGET safestack) |
Peter Collingbourne | b64d0b1 | 2015-06-15 21:08:47 +0000 | [diff] [blame] | 33 | endforeach() |
| 34 | endif() |