diff options
author | Alexey Samsonov <samsonov@google.com> | 2012-08-10 14:45:52 +0000 |
---|---|---|
committer | Alexey Samsonov <samsonov@google.com> | 2012-08-10 14:45:52 +0000 |
commit | fb844c7effdb52dd9fdcc391be28c940ccbf487b (patch) | |
tree | 43a76df3f6a9ea5ef6069e25d29cab0aae2794d3 /compiler-rt/lib/interception | |
parent | ea7d906b0ffff918a7d98c8b6c1f74e3c38cf23b (diff) | |
download | bcm5719-llvm-fb844c7effdb52dd9fdcc391be28c940ccbf487b.tar.gz bcm5719-llvm-fb844c7effdb52dd9fdcc391be28c940ccbf487b.zip |
[ASan] CMake support for building ASan runtime as a universal binary on Mac
llvm-svn: 161665
Diffstat (limited to 'compiler-rt/lib/interception')
-rw-r--r-- | compiler-rt/lib/interception/CMakeLists.txt | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/compiler-rt/lib/interception/CMakeLists.txt b/compiler-rt/lib/interception/CMakeLists.txt index 3ebeb61f08e..aacecf9b8b0 100644 --- a/compiler-rt/lib/interception/CMakeLists.txt +++ b/compiler-rt/lib/interception/CMakeLists.txt @@ -24,19 +24,23 @@ if(SUPPORTS_NO_VARIADIC_MACROS_FLAG) list(APPEND INTERCEPTION_CFLAGS -Wno-variadic-macros) endif() -set(INTERCEPTION_COMMON_DEFINITIONS) - -if(CAN_TARGET_X86_64) - add_library(RTInterception.x86_64 OBJECT ${INTERCEPTION_SOURCES}) - set_target_compile_flags(RTInterception.x86_64 - ${INTERCEPTION_CFLAGS} ${TARGET_X86_64_CFLAGS}) - set_property(TARGET RTInterception.x86_64 APPEND PROPERTY - COMPILE_DEFINITIONS ${INTERCEPTION_COMMON_DEFINITIONS}) -endif() -if(CAN_TARGET_I386) - add_library(RTInterception.i386 OBJECT ${INTERCEPTION_SOURCES}) - set_target_compile_flags(RTInterception.i386 - ${INTERCEPTION_CFLAGS} ${TARGET_I386_CFLAGS}) - set_property(TARGET RTInterception.i386 APPEND PROPERTY - COMPILE_DEFINITIONS ${INTERCEPTION_COMMON_DEFINITIONS}) +if(APPLE) + # Build universal binary on APPLE. + add_library(RTInterception.osx OBJECT ${INTERCEPTION_SOURCES}) + set_target_compile_flags(RTInterception.osx ${INTERCEPTION_CFLAGS}) + filter_available_targets(INTERCEPTION_TARGETS x86_64 i386) + set_target_properties(RTInterception.osx PROPERTIES + OSX_ARCHITECTURES "${INTERCEPTION_TARGETS}") +else() + # Otherwise, build separate libraries for each target. + if(CAN_TARGET_X86_64) + add_library(RTInterception.x86_64 OBJECT ${INTERCEPTION_SOURCES}) + set_target_compile_flags(RTInterception.x86_64 + ${INTERCEPTION_CFLAGS} ${TARGET_X86_64_CFLAGS}) + endif() + if(CAN_TARGET_I386) + add_library(RTInterception.i386 OBJECT ${INTERCEPTION_SOURCES}) + set_target_compile_flags(RTInterception.i386 + ${INTERCEPTION_CFLAGS} ${TARGET_I386_CFLAGS}) + endif() endif() |