[runtimes] Create check- targets for LLVM_RUNTIME_DISTRIBUTION_COMPONENTS
authorShoaib Meenai <smeenai@fb.com>
Wed, 30 Nov 2022 01:41:57 +0000 (17:41 -0800)
committerShoaib Meenai <smeenai@fb.com>
Wed, 30 Nov 2022 19:14:37 +0000 (11:14 -0800)
The sub-component check targets won't be automatically created until the
runtime configurations have run (and the main LLVM configure has rerun
afterwards). Work around this by creating check- targets for components
in LLVM_RUNTIME_DISTRIBUTION_COMPONENTS as well (and making sure they
get the proper test dependencies).

Reviewed By: phosek

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

llvm/runtimes/CMakeLists.txt

index 76ad1d6..b37c893 100644 (file)
@@ -301,7 +301,15 @@ function(runtime_register_target name target)
     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(component_check_targets)
+    foreach(component IN LISTS LLVM_RUNTIME_DISTRIBUTION_COMPONENTS)
+      if(NOT "check-${component}" IN_LIST SUB_CHECK_TARGETS)
+        list(APPEND component_check_targets "check-${component}")
+      endif()
+    endforeach()
+
+    foreach(target_name IN LISTS SUB_CHECK_TARGETS component_check_targets)
       set(${target_name}-${name} ${target_name})
       list(APPEND ${name}_test_targets ${target_name}-${name})
       list(APPEND test_targets ${target_name}-${name})