Right now the only way to force libc++abi tests to link with the static version of libc++abi is to set LIBCXXABI_ENABLE_SHARED to OFF. However, this doesn't work when libc++abi is built as standalone project because of this.
This change allows specifying the version of the library for tests to link with.
This is useful for remote testing, for example, with SSHExecutor, where we _have_ to link with libc++abi statically.
Two new CMake options are introduced here: LIBCXXABI_LINK_TESTS_WITH_SHARED_LIBCXXABI and LIBCXXABI_LINK_TESTS_WITH_SHARED_LIBCXX. They can be set to OFF to tell the test utility to link tests with the static libraries.
It shouldn't break anything, because the default values of these options are set such that the test utility will behave the same way.
Have you considered using cmake_dependent_option? That way you don't need to do the validation below yourself.