Add missing lld checks in sanitizer tests.
authorEvgenii Stepanov <eugenis@google.com>
Mon, 28 Oct 2019 17:21:01 +0000 (10:21 -0700)
committerEvgenii Stepanov <eugenis@google.com>
Mon, 28 Oct 2019 17:32:46 +0000 (10:32 -0700)
Do not add an lld dependency when this target does not exist. In this
case the system installation of lld is used (or whatever is detected
with -fuse-ld=lld by default).

compiler-rt/test/asan/CMakeLists.txt
compiler-rt/test/cfi/CMakeLists.txt
compiler-rt/test/fuzzer/CMakeLists.txt

index 79e34a0..e67a0e8 100644 (file)
@@ -30,7 +30,7 @@ endmacro()
 set(ASAN_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS})
 if(NOT COMPILER_RT_STANDALONE_BUILD)
   list(APPEND ASAN_TEST_DEPS asan)
-  if(NOT APPLE AND COMPILER_RT_HAS_LLD)
+  if(NOT APPLE AND COMPILER_RT_HAS_LLD AND TARGET lld)
     list(APPEND ASAN_TEST_DEPS lld)
   endif()
 endif()
index 9b6ef0f..a787ecd 100644 (file)
@@ -86,7 +86,7 @@ if(NOT COMPILER_RT_STANDALONE_BUILD)
       )
     endif()
   endif()
-  if(NOT APPLE AND COMPILER_RT_HAS_LLD)
+  if(NOT APPLE AND COMPILER_RT_HAS_LLD AND TARGET lld)
     list(APPEND CFI_TEST_DEPS
       lld
     )
index 25bdcd2..5618096 100644 (file)
@@ -7,7 +7,7 @@ if (NOT COMPILER_RT_STANDALONE_BUILD)
   if (COMPILER_RT_HAS_DFSAN)
     list(APPEND LIBFUZZER_TEST_DEPS dfsan)
   endif()
-  if(NOT APPLE AND COMPILER_RT_HAS_LLD)
+  if(NOT APPLE AND COMPILER_RT_HAS_LLD AND TARGET lld)
     list(APPEND LIBFUZZER_TEST_DEPS lld)
   endif()
 endif()