[libc++] Re-apply "Build GoogleBenchmark directly from Lit" (#225856)

Previously, we would build GoogleBenchmark against the just-built
library, not against the library being tested. When testing historical
versions of libc++ or other standard libraries, this breaks. So instead
of building Google Benchmark against the just-built library in CMake, do
it from Lit as part of the test suite's configuration.

I'm not a huge fan of using Lit as a poor man's build system and we
should make the CMake test suite self-contained, however this is a step
in the right direction and it removes a major coupling between the test
suite and the regular libc++ build.

This patch re-applies 1bfe9893f3dc which was reverted in 62ea87e542c3
because it broke the Fuchsia bots. This new version of the patch also
threads through the path to the CMake program being used, the CMake
generator and the CMake "make program" from the top-level CMake to the
test-suite, so that the Google Benchmark build can inherit what the
top-level CMake is using.

GitOrigin-RevId: 8ee4426e3dae25d155d102d20f7cd395bd035174
2 files changed
tree: c3f031407d6e1828b31836e5b8ad02a524086c99
  1. cmake/
  2. docs/
  3. include/
  4. src/
  5. test/
  6. .clang-format
  7. CMakeLists.txt
  8. LICENSE.TXT