[Lldb-commits] [lldb] c7511b4 - [lldb] Correctly add runtime test dependencies

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Wed Aug 31 16:37:47 PDT 2022


Author: Jonas Devlieghere
Date: 2022-08-31T16:37:35-07:00
New Revision: c7511b4ecf45c174c43d9177b843f15e2f3bd68b

URL: https://github.com/llvm/llvm-project/commit/c7511b4ecf45c174c43d9177b843f15e2f3bd68b
DIFF: https://github.com/llvm/llvm-project/commit/c7511b4ecf45c174c43d9177b843f15e2f3bd68b.diff

LOG: [lldb] Correctly add runtime test dependencies

When a runtime is enabled through LLVM_ENABLE_RUNTIMES, it is loaded
after other projects (i.e. after LLDB). This means that the
corresponding targets don't exist when LLDB is configured. To support
runtimes being enable this way, we need to check if they're listed in
LLVM_ENABLE_RUNTIMES. For runtimes being enabled as projects (i.e.
through LLVM_ENABLE_RUNTIMES) we need to check for the target.

This patch unifies things and correctly adds compiler-rt and libcxx as
test dependencies in both scenarios.

Added: 
    

Modified: 
    lldb/test/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/lldb/test/CMakeLists.txt b/lldb/test/CMakeLists.txt
index e2a044349989..64a9082df52e 100644
--- a/lldb/test/CMakeLists.txt
+++ b/lldb/test/CMakeLists.txt
@@ -95,22 +95,16 @@ endif()
 if(TARGET clang)
   add_lldb_test_dependency(clang)
 
-  if(TARGET asan)
-    add_lldb_test_dependency(asan)
-  endif()
-
-  if(TARGET tsan)
-    add_lldb_test_dependency(tsan)
+  if (TARGET libcxx OR ("libcxx" IN_LIST LLVM_ENABLE_RUNTIMES))
+    set(LLDB_HAS_LIBCXX ON)
+    add_lldb_test_dependency(cxx)
   endif()
 
-  if (TARGET compiler-rt)
+  if (TARGET compiler-rt OR "compiler-rt" IN_LIST LLVM_ENABLE_RUNTIMES)
+    set(LLDB_HAS_COMPILER_RT ON)
     add_lldb_test_dependency(compiler-rt)
   endif()
 
-  if (TARGET runtimes)
-    add_lldb_test_dependency(runtimes)
-  endif()
-
   if(APPLE AND NOT LLVM_TARGET_IS_CROSSCOMPILE_HOST)
     # FIXME: Standalone builds should import the cxx target as well.
     if(LLDB_BUILT_STANDALONE)
@@ -122,7 +116,7 @@ if(TARGET clang)
     else()
       # We require libcxx for the test suite, so if we aren't building it,
       # provide a helpful error about how to resolve the situation.
-      if(NOT TARGET cxx AND NOT libcxx IN_LIST LLVM_ENABLE_RUNTIMES)
+      if(NOT LLDB_HAS_LIBCXX)
         message(FATAL_ERROR
           "LLDB test suite requires libc++, but it is currently disabled. "
           "Please add `libcxx` to `LLVM_ENABLE_RUNTIMES` or disable tests via "
@@ -130,15 +124,6 @@ if(TARGET clang)
       endif()
     endif()
   endif()
-
-  # Add libc++ dependency for libc++-specific tests. This is an optional
-  # dependency as it's also possible to run the libc++ tests against the libc++
-  # installed on the system.
-  if (TARGET cxx)
-    set(LLDB_HAS_LIBCXX ON)
-    add_lldb_test_dependency(cxx)
-  endif()
-
 endif()
 
 if (LLDB_BUILT_STANDALONE)


        


More information about the lldb-commits mailing list