summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Rodríguez Troitiño <drodriguez@users.noreply.github.com>2024-02-15 00:49:09 +0100
committerGitHub <noreply@github.com>2024-02-14 15:49:09 -0800
commit4eb092d9f8999338fd4c7ef65268649636b7f86a (patch)
treef50c9a9f8ef2c59b4642d7738964348c92f91455
parent82ca75239340c6e2b92125fe39bf872faa044f11 (diff)
[llvm][compiler-rt] Connect lit dependencies to test-depends targets. (#81783)
compiler-rt was creating the test-depends targets and trying to fill its dependencies with a variable, but the variable was empty because it was supposed to take its value from a property. The changes in this commit grab the value of the property and add them as dependencies. The changes in llvm are to remove the usage of `DEPENDS` arguments from `add_custom_target`, which according to the documentation is reserved for files/outputs created by `add_custom_command`. Use `add_dependencies` instead. This is similar to the changes introduced in 4eb84582344f97167b6a2b4cb1fb1d75ae07897e for runtimes.
-rw-r--r--compiler-rt/test/CMakeLists.txt6
-rw-r--r--llvm/CMakeLists.txt6
2 files changed, 9 insertions, 3 deletions
diff --git a/compiler-rt/test/CMakeLists.txt b/compiler-rt/test/CMakeLists.txt
index ee2ef907bcae..c186be1e44fd 100644
--- a/compiler-rt/test/CMakeLists.txt
+++ b/compiler-rt/test/CMakeLists.txt
@@ -116,7 +116,11 @@ endif()
# Now that we've traversed all the directories and know all the lit testsuites,
# introduce a rule to run to run all of them.
-add_custom_target(compiler-rt-test-depends DEPENDS ${LLVM_COMPILER_RT_LIT_DEPENDS})
+get_property(LLVM_COMPILER_RT_LIT_DEPENDS GLOBAL PROPERTY LLVM_COMPILER_RT_LIT_DEPENDS)
+add_custom_target(compiler-rt-test-depends)
+if(LLVM_COMPILER_RT_LIT_DEPENDS)
+ add_dependencies(compiler-rt-test-depends ${LLVM_COMPILER_RT_LIT_DEPENDS})
+endif()
umbrella_lit_testsuite_end(check-compiler-rt)
if(COMPILER_RT_STANDALONE_BUILD)
diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt
index 81f2753a4edd..a760a19efcb6 100644
--- a/llvm/CMakeLists.txt
+++ b/llvm/CMakeLists.txt
@@ -1256,8 +1256,10 @@ if( LLVM_INCLUDE_TESTS )
get_property(LLVM_ALL_LIT_DEPENDS GLOBAL PROPERTY LLVM_ALL_LIT_DEPENDS)
get_property(LLVM_ALL_ADDITIONAL_TEST_DEPENDS
GLOBAL PROPERTY LLVM_ALL_ADDITIONAL_TEST_DEPENDS)
- add_custom_target(test-depends
- DEPENDS ${LLVM_ALL_LIT_DEPENDS} ${LLVM_ALL_ADDITIONAL_TEST_DEPENDS})
+ add_custom_target(test-depends)
+ if(LLVM_ALL_LIT_DEPENDS OR LLVM_ALL_ADDITIONAL_TEST_DEPENDS)
+ add_dependencies(test-depends ${LLVM_ALL_LIT_DEPENDS} ${LLVM_ALL_ADDITIONAL_TEST_DEPENDS})
+ endif()
set_target_properties(test-depends PROPERTIES FOLDER "Tests")
add_dependencies(check-all test-depends)
endif()