diff --git a/libcxx/test/CMakeLists.txt b/libcxx/test/CMakeLists.txt --- a/libcxx/test/CMakeLists.txt +++ b/libcxx/test/CMakeLists.txt @@ -26,6 +26,11 @@ serialize_lit_param(enable_assertions True) endif() +if (NOT LIBCXX_TEST_COMPILER) + set(LIBCXX_TEST_COMPILER "${CMAKE_CXX_COMPILER}" CACHE PATH + "Path to the Lit test compiler.") +endif() + if (CMAKE_CXX_COMPILER_TARGET) serialize_lit_param(target_triple "\"${CMAKE_CXX_COMPILER_TARGET}\"") else() diff --git a/libcxx/test/configs/cmake-bridge.cfg.in b/libcxx/test/configs/cmake-bridge.cfg.in --- a/libcxx/test/configs/cmake-bridge.cfg.in +++ b/libcxx/test/configs/cmake-bridge.cfg.in @@ -24,7 +24,7 @@ # Add substitutions for bootstrapping the test suite configuration import shlex -config.substitutions.append(('%{cxx}', shlex.quote('@CMAKE_CXX_COMPILER@'))) +config.substitutions.append(('%{cxx}', shlex.quote('@LIBCXX_TEST_COMPILER@'))) config.substitutions.append(('%{libcxx}', '@LIBCXX_SOURCE_DIR@')) config.substitutions.append(('%{include}', '@LIBCXX_GENERATED_INCLUDE_DIR@')) config.substitutions.append(('%{target-include}', '@LIBCXX_GENERATED_INCLUDE_TARGET_DIR@')) diff --git a/libcxxabi/test/CMakeLists.txt b/libcxxabi/test/CMakeLists.txt --- a/libcxxabi/test/CMakeLists.txt +++ b/libcxxabi/test/CMakeLists.txt @@ -47,6 +47,11 @@ serialize_lit_param(use_sanitizer "\"${LLVM_USE_SANITIZER}\"") endif() +if (NOT LIBCXX_TEST_COMPILER) + set(LIBCXX_TEST_COMPILER "${CMAKE_CXX_COMPILER}" CACHE PATH + "Path to the Lit test compiler.") +endif() + if (CMAKE_CXX_COMPILER_TARGET) serialize_lit_param(target_triple "\"${CMAKE_CXX_COMPILER_TARGET}\"") else() diff --git a/libcxxabi/test/configs/cmake-bridge.cfg.in b/libcxxabi/test/configs/cmake-bridge.cfg.in --- a/libcxxabi/test/configs/cmake-bridge.cfg.in +++ b/libcxxabi/test/configs/cmake-bridge.cfg.in @@ -26,7 +26,7 @@ # TODO: This is a non-standard Lit attribute and we should have another way of accessing this. config.host_triple = '@LLVM_HOST_TRIPLE@' -config.substitutions.append(('%{cxx}', '@CMAKE_CXX_COMPILER@')) +config.substitutions.append(('%{cxx}', '@LIBCXX_TEST_COMPILER@')) config.substitutions.append(('%{libcxx}', '@LIBCXXABI_LIBCXX_PATH@')) config.substitutions.append(('%{include}', '@LIBCXXABI_SOURCE_DIR@/include')) config.substitutions.append(('%{cxx-include}', '@LIBCXXABI_HEADER_DIR@/include/c++/v1')) diff --git a/libunwind/test/CMakeLists.txt b/libunwind/test/CMakeLists.txt --- a/libunwind/test/CMakeLists.txt +++ b/libunwind/test/CMakeLists.txt @@ -26,6 +26,11 @@ serialize_lit_param(use_sanitizer "\"${LLVM_USE_SANITIZER}\"") endif() +if (NOT LIBCXX_TEST_COMPILER) + set(LIBCXX_TEST_COMPILER "${CMAKE_CXX_COMPILER}" CACHE PATH + "Path to the Lit test compiler.") +endif() + if (CMAKE_CXX_COMPILER_TARGET) serialize_lit_param(target_triple "\"${CMAKE_CXX_COMPILER_TARGET}\"") else() diff --git a/libunwind/test/configs/cmake-bridge.cfg.in b/libunwind/test/configs/cmake-bridge.cfg.in --- a/libunwind/test/configs/cmake-bridge.cfg.in +++ b/libunwind/test/configs/cmake-bridge.cfg.in @@ -30,7 +30,7 @@ # Add substitutions for bootstrapping the test suite configuration import shlex -config.substitutions.append(('%{cxx}', shlex.quote('@CMAKE_CXX_COMPILER@'))) +config.substitutions.append(('%{cxx}', shlex.quote('@LIBCXX_TEST_COMPILER@'))) config.substitutions.append(('%{executor}', '@LIBUNWIND_EXECUTOR@')) config.substitutions.append(('%{include}', '@LIBUNWIND_SOURCE_DIR@/include')) config.substitutions.append(('%{lib}', '@LIBUNWIND_LIBRARY_DIR@'))