Skip to content

Commit 4eb092d

Browse files
authored
[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 4eb8458 for runtimes.
1 parent 82ca752 commit 4eb092d

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

compiler-rt/test/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,11 @@ endif()
116116

117117
# Now that we've traversed all the directories and know all the lit testsuites,
118118
# introduce a rule to run to run all of them.
119-
add_custom_target(compiler-rt-test-depends DEPENDS ${LLVM_COMPILER_RT_LIT_DEPENDS})
119+
get_property(LLVM_COMPILER_RT_LIT_DEPENDS GLOBAL PROPERTY LLVM_COMPILER_RT_LIT_DEPENDS)
120+
add_custom_target(compiler-rt-test-depends)
121+
if(LLVM_COMPILER_RT_LIT_DEPENDS)
122+
add_dependencies(compiler-rt-test-depends ${LLVM_COMPILER_RT_LIT_DEPENDS})
123+
endif()
120124
umbrella_lit_testsuite_end(check-compiler-rt)
121125

122126
if(COMPILER_RT_STANDALONE_BUILD)

llvm/CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1256,8 +1256,10 @@ if( LLVM_INCLUDE_TESTS )
12561256
get_property(LLVM_ALL_LIT_DEPENDS GLOBAL PROPERTY LLVM_ALL_LIT_DEPENDS)
12571257
get_property(LLVM_ALL_ADDITIONAL_TEST_DEPENDS
12581258
GLOBAL PROPERTY LLVM_ALL_ADDITIONAL_TEST_DEPENDS)
1259-
add_custom_target(test-depends
1260-
DEPENDS ${LLVM_ALL_LIT_DEPENDS} ${LLVM_ALL_ADDITIONAL_TEST_DEPENDS})
1259+
add_custom_target(test-depends)
1260+
if(LLVM_ALL_LIT_DEPENDS OR LLVM_ALL_ADDITIONAL_TEST_DEPENDS)
1261+
add_dependencies(test-depends ${LLVM_ALL_LIT_DEPENDS} ${LLVM_ALL_ADDITIONAL_TEST_DEPENDS})
1262+
endif()
12611263
set_target_properties(test-depends PROPERTIES FOLDER "Tests")
12621264
add_dependencies(check-all test-depends)
12631265
endif()

0 commit comments

Comments
 (0)