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 | d8b76ce | 2015-08-18 18:35:18 +0000 | [diff] [blame] | 11 | foreach (os osx) |
Chris Bieneman | 201d065 | 2015-08-18 17:32:18 +0000 | [diff] [blame] | 12 | add_compiler_rt_darwin_runtime(clang_rt.safestack_${os} ${os} |
| 13 | STATIC |
Kuba Brecka | 746da5f | 2015-08-19 14:03:51 +0000 | [diff] [blame] | 14 | ARCHS ${SAFESTACK_SUPPORTED_ARCH} |
Chris Bieneman | 201d065 | 2015-08-18 17:32:18 +0000 | [diff] [blame] | 15 | SOURCES ${SAFESTACK_SOURCES} |
| 16 | $<TARGET_OBJECTS:RTInterception.${os}> |
| 17 | $<TARGET_OBJECTS:RTSanitizerCommon.${os}> |
| 18 | CFLAGS ${SAFESTACK_CFLAGS}) |
| 19 | add_dependencies(safestack clang_rt.safestack_${os}) |
| 20 | endforeach() |
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}) |
| 24 | add_compiler_rt_runtime(clang_rt.safestack-${arch} ${arch} STATIC |
| 25 | SOURCES ${SAFESTACK_SOURCES} |
| 26 | $<TARGET_OBJECTS:RTInterception.${arch}> |
| 27 | $<TARGET_OBJECTS:RTSanitizerCommon.${arch}> |
Evgeniy Stepanov | 5a268b1 | 2015-07-23 22:05:20 +0000 | [diff] [blame] | 28 | $<TARGET_OBJECTS:RTSanitizerCommonNoLibc.${arch}> |
Peter Collingbourne | b64d0b1 | 2015-06-15 21:08:47 +0000 | [diff] [blame] | 29 | CFLAGS ${SAFESTACK_CFLAGS}) |
| 30 | add_dependencies(safestack clang_rt.safestack-${arch}) |
| 31 | endforeach() |
| 32 | endif() |