[TSan] Build TSan unit tests with the same compile flags as TSan runtime

llvm-svn: 177859
This commit is contained in:
Alexey Samsonov 2013-03-25 10:23:20 +00:00
parent 4adf49d253
commit 31a2c483ed
1 changed files with 3 additions and 3 deletions

View File

@ -12,9 +12,9 @@ function(add_tsan_unittest testname)
add_unittest(TsanUnitTests ${testname} ${ARGN}) add_unittest(TsanUnitTests ${testname} ${ARGN})
# Link with TSan runtime. # Link with TSan runtime.
target_link_libraries(${testname} clang_rt.tsan-x86_64) target_link_libraries(${testname} clang_rt.tsan-x86_64)
# Build tests with PIE and debug info. # Compile tests with the same flags as TSan runtime.
set_property(TARGET ${testname} APPEND_STRING set_target_compile_flags(${testname} ${TSAN_CFLAGS})
PROPERTY COMPILE_FLAGS " -fPIE -g") # Link tests with -pie.
set_property(TARGET ${testname} APPEND_STRING set_property(TARGET ${testname} APPEND_STRING
PROPERTY LINK_FLAGS " -pie") PROPERTY LINK_FLAGS " -pie")
endif() endif()