diff --git a/compiler-rt/lib/asan/CMakeLists.txt b/compiler-rt/lib/asan/CMakeLists.txt index bf02395dee89..fc3a73efa979 100644 --- a/compiler-rt/lib/asan/CMakeLists.txt +++ b/compiler-rt/lib/asan/CMakeLists.txt @@ -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() diff --git a/compiler-rt/lib/asan/lit_tests/CMakeLists.txt b/compiler-rt/lib/asan/lit_tests/CMakeLists.txt index b65d34742953..72a3f5439b70 100644 --- a/compiler-rt/lib/asan/lit_tests/CMakeLists.txt +++ b/compiler-rt/lib/asan/lit_tests/CMakeLists.txt @@ -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) diff --git a/compiler-rt/lib/asan/tests/CMakeLists.txt b/compiler-rt/lib/asan/tests/CMakeLists.txt index e90dbeec15a7..fc0f1788bd35 100644 --- a/compiler-rt/lib/asan/tests/CMakeLists.txt +++ b/compiler-rt/lib/asan/tests/CMakeLists.txt @@ -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)