summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey Samsonov <samsonov@google.com>2013-11-14 12:24:12 +0000
committerAlexey Samsonov <samsonov@google.com>2013-11-14 12:24:12 +0000
commit8c6e4855ac47415f1f2863690860f24213638cb5 (patch)
tree2691887b47a84736ec7a8c358b8a93ed166fc26e
parentaed8584ec902e6fe67c03f1102feee6a3f1bdd14 (diff)
downloadcompiler-rt-8c6e4855ac47415f1f2863690860f24213638cb5.tar.gz
[ASan] Introduce a top-level target to collect all ASan runtimes and deps
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@194696 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/asan/CMakeLists.txt4
-rw-r--r--lib/asan/lit_tests/CMakeLists.txt3
-rw-r--r--lib/asan/tests/CMakeLists.txt4
3 files changed, 7 insertions, 4 deletions
diff --git a/lib/asan/CMakeLists.txt b/lib/asan/CMakeLists.txt
index bf02395de..fc3a73efa 100644
--- a/lib/asan/CMakeLists.txt
+++ b/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/lib/asan/lit_tests/CMakeLists.txt b/lib/asan/lit_tests/CMakeLists.txt
index b65d34742..72a3f5439 100644
--- a/lib/asan/lit_tests/CMakeLists.txt
+++ b/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/lib/asan/tests/CMakeLists.txt b/lib/asan/tests/CMakeLists.txt
index e90dbeec1..fc0f1788b 100644
--- a/lib/asan/tests/CMakeLists.txt
+++ b/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)