[ASan] cmake unit tests: explicitly add necessary linker flags when linking unit tests with asan runtime

llvm-svn: 159420
This commit is contained in:
Alexey Samsonov 2012-06-29 11:29:39 +00:00
parent 548b7b5b0e
commit c37ac17629
1 changed files with 6 additions and 2 deletions

View File

@ -52,8 +52,12 @@ function(add_asan_test testname)
endif()
if (APPLE)
# Darwin-specific linker flags.
set_target_properties(${testname} PROPERTIES
LINK_FLAGS "-framework Foundation")
set_property(TARGET ${testname} APPEND PROPERTY
LINK_FLAGS "-framework CoreFoundation")
elseif (UNIX)
# Linux-specific linker flags.
set_property(TARGET ${testname} APPEND PROPERTY
LINK_FLAGS "-lpthread -ldl -export-dynamic")
endif()
get_property(compile_flags TARGET ${testname} PROPERTY COMPILE_FLAGS)
foreach(arg ${ASAN_UNITTEST_COMMON_CFLAGS})