forked from OSchip/llvm-project
[ASan] Introduce a top-level target to collect all ASan runtimes and deps
llvm-svn: 194696
This commit is contained in:
parent
bef6171f7d
commit
003c4bfc42
|
@ -143,6 +143,10 @@ endif()
|
|||
|
||||
add_compiler_rt_resource_file(asan_blacklist asan_blacklist.txt)
|
||||
|
||||
# All ASan runtime dependencies.
|
||||
add_custom_target(asan_runtime_libraries
|
||||
DEPENDS asan_blacklist ${ASAN_RUNTIME_LIBRARIES})
|
||||
|
||||
if(LLVM_INCLUDE_TESTS)
|
||||
add_subdirectory(tests)
|
||||
endif()
|
||||
|
|
|
@ -27,8 +27,7 @@ if(COMPILER_RT_CAN_EXECUTE_TESTS)
|
|||
# Run ASan tests only if we're sure we may produce working binaries.
|
||||
set(ASAN_TEST_DEPS
|
||||
${SANITIZER_COMMON_LIT_TEST_DEPS}
|
||||
${ASAN_RUNTIME_LIBRARIES}
|
||||
asan_blacklist)
|
||||
asan_runtime_libraries)
|
||||
set(ASAN_TEST_PARAMS
|
||||
asan_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg)
|
||||
if(LLVM_INCLUDE_TESTS)
|
||||
|
|
|
@ -106,7 +106,7 @@ macro(asan_compile obj_list source arch)
|
|||
get_target_flags_for_arch(${arch} TARGET_CFLAGS)
|
||||
clang_compile(${output_obj} ${source}
|
||||
CFLAGS ${ARGN} ${TARGET_CFLAGS}
|
||||
DEPS gtest ${ASAN_RUNTIME_LIBRARIES}
|
||||
DEPS gtest asan_runtime_libraries
|
||||
${ASAN_UNITTEST_HEADERS}
|
||||
${ASAN_BLACKLIST_FILE})
|
||||
list(APPEND ${obj_list} ${output_obj})
|
||||
|
@ -117,7 +117,7 @@ endmacro()
|
|||
macro(add_asan_test test_suite test_name arch)
|
||||
parse_arguments(TEST "OBJECTS;LINKFLAGS" "WITH_TEST_RUNTIME" ${ARGN})
|
||||
get_target_flags_for_arch(${arch} TARGET_LINK_FLAGS)
|
||||
set(TEST_DEPS ${ASAN_RUNTIME_LIBRARIES} ${TEST_OBJECTS})
|
||||
set(TEST_DEPS asan_runtime_libraries ${TEST_OBJECTS})
|
||||
if(TEST_WITH_TEST_RUNTIME)
|
||||
list(APPEND TEST_DEPS ${ASAN_TEST_RUNTIME})
|
||||
list(APPEND TEST_OBJECTS lib${ASAN_TEST_RUNTIME}.a)
|
||||
|
|
Loading…
Reference in New Issue