[libcxx-commits] [PATCH] D137110: [libc++] Option to specify a different compiler for testing

Jake Egan via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Oct 31 13:33:01 PDT 2022


Jake-Egan created this revision.
Herald added projects: libunwind, All.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libunwind.
Jake-Egan requested review of this revision.
Herald added projects: libc++, libc++abi.
Herald added a reviewer: libc++.
Herald added a reviewer: libc++abi.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D137110

Files:
  libcxx/test/CMakeLists.txt
  libcxx/test/configs/cmake-bridge.cfg.in
  libcxxabi/test/CMakeLists.txt
  libcxxabi/test/configs/cmake-bridge.cfg.in
  libunwind/test/CMakeLists.txt
  libunwind/test/configs/cmake-bridge.cfg.in


Index: libunwind/test/configs/cmake-bridge.cfg.in
===================================================================
--- libunwind/test/configs/cmake-bridge.cfg.in
+++ 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@'))
Index: libunwind/test/CMakeLists.txt
===================================================================
--- libunwind/test/CMakeLists.txt
+++ 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()
Index: libcxxabi/test/configs/cmake-bridge.cfg.in
===================================================================
--- libcxxabi/test/configs/cmake-bridge.cfg.in
+++ 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'))
Index: libcxxabi/test/CMakeLists.txt
===================================================================
--- libcxxabi/test/CMakeLists.txt
+++ 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()
Index: libcxx/test/configs/cmake-bridge.cfg.in
===================================================================
--- libcxx/test/configs/cmake-bridge.cfg.in
+++ 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@'))
Index: libcxx/test/CMakeLists.txt
===================================================================
--- libcxx/test/CMakeLists.txt
+++ 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()


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D137110.472117.patch
Type: text/x-patch
Size: 3684 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20221031/02ddcfbe/attachment.bin>


More information about the libcxx-commits mailing list