This patch enables the use of the libc++ test-suite on its own (without needing to build the runtime). To do this, use the option LIBCXX_TEST_ONLY. The header and library location of an existing runtime needs to be specified with LIBCXX_EXTERNAL_HEADER_DIR and LIBCXX_EXTERNAL_LIBRARY_DIR. Example for configuring and running the test-suite:
$ cmake -G Ninja -DCMAKE_CXX_COMPILER=/some/c++ -DLLVM_ENABLE_RUNTIMES=libcxx -DLIBCXX_TEST_CONFIG=ibm-libc++-shared.cfg.in -DLIBCXX_TEST_ONLY=ON -DLIBCXX_EXTERNAL_HEADER_DIR=/path/to/build/include/c++/v1 -DLIBCXX_EXTERNAL_LIBRARY_DIR=/path/to/build/lib $ ninja check-cxx
Benefits of this change include:
- Allows for a different compiler (different from the compiler used to build the runtime) to be specified for testing (with CMAKE_CXX_COMPILER)
- Allows platforms to run only the test-suite (if they don’t care about building the runtime).