[runtimes] Ensure required deps for tests targets are actually built
authorLeonard Chan <leonardchan@google.com>
Wed, 29 Sep 2021 21:40:28 +0000 (14:40 -0700)
committerLeonard Chan <leonardchan@google.com>
Wed, 29 Sep 2021 21:41:33 +0000 (14:41 -0700)
When building compiler-rt via runtimes, many tests fail because tools like
FileCheck and count aren't built yet. This is because the RUNTIME_TEST_DEPENDENCIES
haven't been added to any of the compiler-rt targets. The fix is to explicitly
add any runtimes as test_targets.

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

llvm/runtimes/CMakeLists.txt

index 1ec808e..7e5f915 100644 (file)
@@ -294,6 +294,7 @@ function(runtime_register_target name target)
     set(runtimes-test-depends-${name} runtimes-test-depends)
     set(check-runtimes-${name} check-runtimes)
     list(APPEND ${name}_test_targets runtimes-test-depends-${name} check-runtimes-${name})
+    list(APPEND test_targets ${${name}_test_targets})
     foreach(target_name IN LISTS SUB_CHECK_TARGETS)
       set(${target_name}-${name} ${target_name})
       list(APPEND ${name}_test_targets ${target_name}-${name})