This is essentially D71894, but for libc++.
This is needed for running libc++ tests over SSH.
FWIW, I'm working on a refactoring of the way we configure lit that should get rid of pretty much all testing logic inside libc++ and libc++abi's CMake files. So I'm OK with this change if it helps you right now, however if what I'm working on works well, we'll get rid of it.
This broke CMake configuration with the following set of arguments: -DLLVM_ENABLE_PROJECTS=libcxx -DLIBCXX_ENABLE_SHARED=OFF -DLIBCXX_ENABLE_STATIC=OFF -DLIBCXX_INCLUDE_TESTS=OFF. Fixed in:
commit b58902bc72c2b479b5ed27ec0d3422ba9782edbb Author: Louis Dionne <email@example.com> Date: Wed Mar 25 16:50:19 2020 -0400 [libc++] Fix CMake configuration breakage when libc++ is built neither static nor dynamic Introduced by https://reviews.llvm.org/D72687. This condition can happen when the tests are not being run at all, and we're only trying to generate the libc++ headers.