From 2d0b1f8f92e7dfb4a69836c29113135b108c8056 Mon Sep 17 00:00:00 2001 From: Timur Iskhodzhanov Date: Tue, 13 May 2014 12:57:50 +0000 Subject: [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 --- lib/asan/tests/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/asan/tests/CMakeLists.txt') 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. -- cgit v1.2.1