diff options
author | Alexey Samsonov <samsonov@google.com> | 2013-01-21 08:12:20 +0000 |
---|---|---|
committer | Alexey Samsonov <samsonov@google.com> | 2013-01-21 08:12:20 +0000 |
commit | 2aad7c137771f6f7a734390e09c94a13120d054a (patch) | |
tree | af7b1a2a0290944f98d2312ec9b857a423123993 /lib/ubsan | |
parent | 5162314d9538766717b8b6cf3d4a32e88c34bb57 (diff) |
CMake: add functions creating universal runtime libraries for several architectures on OS X and use them in ASan and UBSan build rules
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@173011 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ubsan')
-rw-r--r-- | lib/ubsan/CMakeLists.txt | 28 |
1 files changed, 9 insertions, 19 deletions
diff --git a/lib/ubsan/CMakeLists.txt b/lib/ubsan/CMakeLists.txt index 40d0e8971..b549153e5 100644 --- a/lib/ubsan/CMakeLists.txt +++ b/lib/ubsan/CMakeLists.txt @@ -19,31 +19,21 @@ set(UBSAN_RUNTIME_LIBRARIES) if(APPLE) # Build universal binary on APPLE. - add_library(clang_rt.ubsan_osx STATIC - ${UBSAN_SOURCES} - $<TARGET_OBJECTS:RTSanitizerCommon.osx> - ) - set_target_compile_flags(clang_rt.ubsan_osx ${UBSAN_CFLAGS}) - set_target_properties(clang_rt.ubsan_osx PROPERTIES - OSX_ARCHITECTURES "${UBSAN_SUPPORTED_ARCH}") + add_compiler_rt_osx_static_runtime(clang_rt.ubsan_osx + ARCH ${UBSAN_SUPPORTED_ARCH} + SOURCES ${UBSAN_SOURCES} + $<TARGET_OBJECTS:RTSanitizerCommon.osx> + CFLAGS ${UBSAN_CFLAGS}) list(APPEND UBSAN_RUNTIME_LIBRARIES clang_rt.ubsan_osx) else() # Build separate libraries for each target. foreach(arch ${UBSAN_SUPPORTED_ARCH}) - add_library(clang_rt.ubsan-${arch} STATIC - ${UBSAN_SOURCES} - $<TARGET_OBJECTS:RTSanitizerCommon.${arch}> - ) - set_target_compile_flags(clang_rt.ubsan-${arch} - ${UBSAN_CFLAGS} ${TARGET_${arch}_CFLAGS} - ) + add_compiler_rt_static_runtime(clang_rt.ubsan-${arch} ${arch} + SOURCES ${UBSAN_SOURCES} + $<TARGET_OBJECTS:RTSanitizerCommon.${arch}> + CFLAGS ${UBSAN_CFLAGS}) list(APPEND UBSAN_RUNTIME_LIBRARIES clang_rt.ubsan-${arch}) endforeach() endif() - -set_property(TARGET ${UBSAN_RUNTIME_LIBRARIES} APPEND PROPERTY - COMPILE_DEFINITIONS ${UBSAN_COMMON_DEFINITIONS}) -add_clang_compiler_rt_libraries(${UBSAN_RUNTIME_LIBRARIES}) - add_subdirectory(lit_tests) |