diff options
author | Chris Bieneman <beanz@apple.com> | 2015-08-25 19:53:09 +0000 |
---|---|---|
committer | Chris Bieneman <beanz@apple.com> | 2015-08-25 19:53:09 +0000 |
commit | 0576c367c9981979c19453bc2ff8573d7735ca66 (patch) | |
tree | 4f6c2e43ee4deb133492c6f15b3ba994086c08cf /lib/safestack | |
parent | ce5dd9cb0f58a202b543d80991e1ebd8fed57791 (diff) |
[CMake] merge add_compiler_rt_runtime and add_compiler_rt_darwin_runtime into a single function
Summary: This refactoring moves much of the Apple-specific behavior into a function in AddCompilerRT. The next cleanup patch will remove more of the if(APPLE) checks in the outlying CMakeLists.
This patch adds a bunch of new functionality to add_compiler_rt_runtime so that the target names don't need to be reconstructed outside the call. It also updates some of the call sites to exercise the new functionality, but does not update all uses fully. Subsequent patches will further update call sites and move to using the new features.
Reviewers: filcab, bogner, kubabrecka, zaks.anna, glider, samsonov
Subscribers: beanz, rengolin, llvm-commits
Differential Revision: http://reviews.llvm.org/D12292
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@245970 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/safestack')
-rw-r--r-- | lib/safestack/CMakeLists.txt | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/lib/safestack/CMakeLists.txt b/lib/safestack/CMakeLists.txt index bf843ffe9..f5d31225d 100644 --- a/lib/safestack/CMakeLists.txt +++ b/lib/safestack/CMakeLists.txt @@ -8,25 +8,26 @@ set(SAFESTACK_CFLAGS ${SANITIZER_COMMON_CFLAGS}) if(APPLE) # Build universal binary on APPLE. - foreach (os osx) - add_compiler_rt_darwin_runtime(clang_rt.safestack_${os} ${os} - STATIC - ARCHS ${SAFESTACK_SUPPORTED_ARCH} - SOURCES ${SAFESTACK_SOURCES} - $<TARGET_OBJECTS:RTInterception.${os}> - $<TARGET_OBJECTS:RTSanitizerCommon.${os}> - CFLAGS ${SAFESTACK_CFLAGS}) - add_dependencies(safestack clang_rt.safestack_${os}) - endforeach() + add_compiler_rt_runtime(clang_rt.safestack + STATIC + OS osx + ARCHS ${SAFESTACK_SUPPORTED_ARCH} + SOURCES ${SAFESTACK_SOURCES} + $<TARGET_OBJECTS:RTInterception.osx> + $<TARGET_OBJECTS:RTSanitizerCommon.osx> + CFLAGS ${SAFESTACK_CFLAGS} + PARENT_TARGET safestack) else() # Otherwise, build separate libraries for each target. foreach(arch ${SAFESTACK_SUPPORTED_ARCH}) - add_compiler_rt_runtime(clang_rt.safestack-${arch} ${arch} STATIC + add_compiler_rt_runtime(clang_rt.safestack + STATIC + ARCHS ${arch} SOURCES ${SAFESTACK_SOURCES} $<TARGET_OBJECTS:RTInterception.${arch}> $<TARGET_OBJECTS:RTSanitizerCommon.${arch}> $<TARGET_OBJECTS:RTSanitizerCommonNoLibc.${arch}> - CFLAGS ${SAFESTACK_CFLAGS}) - add_dependencies(safestack clang_rt.safestack-${arch}) + CFLAGS ${SAFESTACK_CFLAGS} + PARENT_TARGET safestack) endforeach() endif() |