diff options
author | Alexey Samsonov <vonosmas@gmail.com> | 2015-01-06 20:58:40 +0000 |
---|---|---|
committer | Alexey Samsonov <vonosmas@gmail.com> | 2015-01-06 20:58:40 +0000 |
commit | 001d038609ab5b91e1e4afa5dc0bf5d5437a2f95 (patch) | |
tree | 7f0b6cc19873bc5e726bb925a1df1757272c8674 /cmake | |
parent | 7a12b63f91ccd4de1d7e07b429360dfde6e330cd (diff) |
[Sanitizer] Improve unit tests in COMPILER_RT_DEBUG=ON mode.
Propagate -DSANITIZER_DEBUG definition to unit tests.
Make sure unit tests depend on compiler-rt headers.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@225298 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/Modules/AddCompilerRT.cmake | 5 | ||||
-rw-r--r-- | cmake/Modules/CompilerRTCompile.cmake | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/cmake/Modules/AddCompilerRT.cmake b/cmake/Modules/AddCompilerRT.cmake index f080fa7d7..1904a4be9 100644 --- a/cmake/Modules/AddCompilerRT.cmake +++ b/cmake/Modules/AddCompilerRT.cmake @@ -131,10 +131,11 @@ set(COMPILER_RT_GTEST_CFLAGS -I${COMPILER_RT_GTEST_PATH} ) +append_list_if(COMPILER_RT_DEBUG -DSANITIZER_DEBUG=1 COMPILER_RT_TEST_CFLAGS) + if(MSVC) # clang doesn't support exceptions on Windows yet. - list(APPEND COMPILER_RT_TEST_CFLAGS - -D_HAS_EXCEPTIONS=0) + list(APPEND COMPILER_RT_TEST_CFLAGS -D_HAS_EXCEPTIONS=0) # We should teach clang to understand "#pragma intrinsic", see PR19898. list(APPEND COMPILER_RT_TEST_CFLAGS -Wno-undefined-inline) diff --git a/cmake/Modules/CompilerRTCompile.cmake b/cmake/Modules/CompilerRTCompile.cmake index af3df8ff4..de73ccfc5 100644 --- a/cmake/Modules/CompilerRTCompile.cmake +++ b/cmake/Modules/CompilerRTCompile.cmake @@ -9,7 +9,7 @@ macro(clang_compile object_file source) parse_arguments(SOURCE "CFLAGS;DEPS" "" ${ARGN}) get_filename_component(source_rpath ${source} REALPATH) if(NOT COMPILER_RT_STANDALONE_BUILD) - list(APPEND SOURCE_DEPS clang) + list(APPEND SOURCE_DEPS clang compiler-rt-headers) endif() if (TARGET CompilerRTUnitTestCheckCxx) list(APPEND SOURCE_DEPS CompilerRTUnitTestCheckCxx) |