Fix building Asan and common sanitizers tests on FreeBSD 9.2

llvm-svn: 207408
This commit is contained in:
Viktor Kutuzov 2014-04-28 10:33:01 +00:00
parent fb68e640d2
commit f9eba2f51d
2 changed files with 9 additions and 0 deletions

View File

@ -50,6 +50,11 @@ set(ASAN_UNITTEST_INSTRUMENTED_CFLAGS
# Unit tests require libstdc++.
set(ASAN_UNITTEST_COMMON_LINKFLAGS -lstdc++)
# x86_64 FreeBSD 9.2 additionally requires libc++ to build the tests.
if(CMAKE_SYSTEM MATCHES "FreeBSD-9.2-RELEASE")
list(APPEND ASAN_UNITTEST_COMMON_LINKFLAGS "-lc++")
endif()
# Unit tests on Mac depend on Foundation.
if(APPLE)
list(APPEND ASAN_UNITTEST_COMMON_LINKFLAGS -framework Foundation)

View File

@ -45,6 +45,10 @@ set(SANITIZER_TEST_LINK_FLAGS_COMMON
-lstdc++)
append_if(COMPILER_RT_HAS_LIBDL -ldl SANITIZER_TEST_LINK_FLAGS_COMMON)
append_if(COMPILER_RT_HAS_LIBPTHREAD -lpthread SANITIZER_TEST_LINK_FLAGS_COMMON)
# x86_64 FreeBSD 9.2 additionally requires libc++ to build the tests.
if(CMAKE_SYSTEM MATCHES "FreeBSD-9.2-RELEASE")
list(APPEND SANITIZER_TEST_LINK_FLAGS_COMMON "-lc++")
endif()
include_directories(..)
include_directories(../..)