Move llvm util dependencies from clang-tools-extra to add_lit_target.
authorHaojian Wu <hokein@google.com>
Mon, 1 Oct 2018 14:00:51 +0000 (14:00 +0000)
committerHaojian Wu <hokein@google.com>
Mon, 1 Oct 2018 14:00:51 +0000 (14:00 +0000)
Summary:
Address fixme in r301762. And would simplify the cmake file in
clang-tools-extra.

Reviewers: sammccall

Subscribers: mgorny, llvm-commits, cfe-commits

Differential Revision: https://reviews.llvm.org/D52713

llvm-svn: 343473

llvm/cmake/modules/AddLLVM.cmake

index 91b9543..4dde95e 100644 (file)
@@ -1367,6 +1367,17 @@ function(add_lit_target target comment)
       COMMAND ${CMAKE_COMMAND} -E echo "${target} does nothing, no tools built.")
     message(STATUS "${target} does nothing.")
   endif()
+
+  # Add lit test dependencies.
+  set(llvm_utils_deps
+    FileCheck count not
+  )
+  foreach(dep ${llvm_utils_deps})
+    if (TARGET ${dep})
+      add_dependencies(${target} ${dep})
+    endif()
+  endforeach()
+
   if (ARG_DEPENDS)
     add_dependencies(${target} ${ARG_DEPENDS})
   endif()