summaryrefslogtreecommitdiff
path: root/lib/asan/tests/CMakeLists.txt
diff options
context:
space:
mode:
authorTimur Iskhodzhanov <timurrrr@google.com>2014-05-13 12:57:50 +0000
committerTimur Iskhodzhanov <timurrrr@google.com>2014-05-13 12:57:50 +0000
commit2d0b1f8f92e7dfb4a69836c29113135b108c8056 (patch)
treef9cdc50f81c37f7abb63720dc352630383102a01 /lib/asan/tests/CMakeLists.txt
parenta7e0cb9c95f2a7560029bb492af35cdfb8e44b6a (diff)
downloadcompiler-rt-2d0b1f8f92e7dfb4a69836c29113135b108c8056.tar.gz
[Sanitizer/ASan tests] Automatically detect the presence of libstdc++
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@208695 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/asan/tests/CMakeLists.txt')
-rw-r--r--lib/asan/tests/CMakeLists.txt4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/asan/tests/CMakeLists.txt b/lib/asan/tests/CMakeLists.txt
index d04f2a836..2e4caa4b8 100644
--- a/lib/asan/tests/CMakeLists.txt
+++ b/lib/asan/tests/CMakeLists.txt
@@ -63,8 +63,10 @@ set(ASAN_UNITTEST_INSTRUMENTED_CFLAGS
)
# Unit tests require libstdc++ on POSIX.
+append_if(COMPILER_RT_HAS_LIBSTDCXX -lstdc++ ASAN_UNITTEST_COMMON_LINKFLAGS)
+
if(NOT MSVC)
- list(APPEND ASAN_UNITTEST_COMMON_LINKFLAGS --driver-mode=g++ -lstdc++)
+ list(APPEND ASAN_UNITTEST_COMMON_LINKFLAGS --driver-mode=g++)
endif()
# x86_64 FreeBSD 9.2 additionally requires libc++ to build the tests.