Running compiler-rt tests when using `LLVM_ENABLE_RUNTIMES`

I’d like some help with my build configuration. I don’t have a lot of experience with CMake, so please bear with me :slight_smile:.

For one of our setups, we have compiler-rt in LLVM_ENABLE_RUNTIMES rather than LLVM_ENABLE_PROJECTS which gives us two separate build graphs, one for main LLVM and the other for the runtimes. We wanted to have the check-profile target in the main LLVM build graph, so we added check-profile to LLVM_RUNTIME_DISTRIBUTION_COMPONENTS.

Unfortunately, when I run ninja check-profile it fails because of missing test tools like FileCheck, count, not,… I can get around this by first running ninja clang-test-depends llvm-test-depends lld-test-depends compiler-rt-headers, but this is obviously less than ideal. As far as I can tell clang does get rebuilt correctly when running the check-profile target.

I’m wondering if there is a way to add the appropriate test dependencies when building in this way. Do we need to somehow have the runtime build configuration ask the LLVM build configuration for the test dependencies?

CC @petrhosek @smeenai