diff options
author | Alexey Samsonov <samsonov@google.com> | 2013-09-16 15:50:53 +0000 |
---|---|---|
committer | Alexey Samsonov <samsonov@google.com> | 2013-09-16 15:50:53 +0000 |
commit | 05fa3808f6ac96023cdf583a1a1b7220e5b451b8 (patch) | |
tree | 61a33375c8c0db94fbf2fcf72a641ab1a48250cf /cmake | |
parent | 22e21b044c9337a2fa921f268b7d221c693ad78b (diff) | |
download | compiler-rt-05fa3808f6ac96023cdf583a1a1b7220e5b451b8.tar.gz compiler-rt-05fa3808f6ac96023cdf583a1a1b7220e5b451b8.tar.bz2 compiler-rt-05fa3808f6ac96023cdf583a1a1b7220e5b451b8.tar.xz |
[ASan] Split ASan unit tests into two different binaries:
(1) instrumented, i.e. compiled and linked with -fsanitize=address
(2) not instrumented, compiled w/o -fsanitize=address and linked with ASan runtime statically.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@190788 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/Modules/AddCompilerRT.cmake | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/cmake/Modules/AddCompilerRT.cmake b/cmake/Modules/AddCompilerRT.cmake index 1ece3eb9..021920c9 100644 --- a/cmake/Modules/AddCompilerRT.cmake +++ b/cmake/Modules/AddCompilerRT.cmake @@ -6,13 +6,16 @@ include(CompilerRTUtils) # with name "<name>.<arch>" if architecture can be targeted. # add_compiler_rt_object_library(<name> <arch> # SOURCES <source files> -# CFLAGS <compile flags>) +# CFLAGS <compile flags> +# DEFS <compile definitions>) macro(add_compiler_rt_object_library name arch) if(CAN_TARGET_${arch}) - parse_arguments(LIB "SOURCES;CFLAGS" "" ${ARGN}) + parse_arguments(LIB "SOURCES;CFLAGS;DEFS" "" ${ARGN}) add_library(${name}.${arch} OBJECT ${LIB_SOURCES}) set_target_compile_flags(${name}.${arch} ${TARGET_${arch}_CFLAGS} ${LIB_CFLAGS}) + set_property(TARGET ${name}.${arch} APPEND PROPERTY + COMPILE_DEFINITIONS ${LIB_DEFS}) else() message(FATAL_ERROR "Archtecture ${arch} can't be targeted") endif() @@ -23,12 +26,15 @@ endmacro() # add_compiler_rt_osx_object_library(<name> ARCH <architectures> # SOURCES <source files> # CFLAGS <compile flags>) +# DEFS <compile definitions>) macro(add_compiler_rt_osx_object_library name) - parse_arguments(LIB "ARCH;SOURCES;CFLAGS" "" ${ARGN}) + parse_arguments(LIB "ARCH;SOURCES;CFLAGS;DEFS" "" ${ARGN}) set(libname "${name}.osx") add_library(${libname} OBJECT ${LIB_SOURCES}) set_target_compile_flags(${libname} ${LIB_CFLAGS}) set_target_properties(${libname} PROPERTIES OSX_ARCHITECTURES "${LIB_ARCH}") + set_property(TARGET ${libname} APPEND PROPERTY + COMPILE_DEFINITIONS ${LIB_DEFS}) endmacro() # Adds static runtime for a given architecture and puts it in the proper |