[compiler-rt] [compiler-rt] Fix C and C++ compilers being switched when compiling tests (PR #110552)

Raul Tambre via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 30 11:33:39 PDT 2024


https://github.com/tambry created https://github.com/llvm/llvm-project/pull/110552

The logic was simply switched. Fixes building tests for me.  
Not sure how I haven't stumbled upon this before considering this code hasn't changed lately and my setup's been the same.

Fixes: 07317bbc66d1f2d7663af3c9f04d0f6c0487ac03

>From 35f04b74a77853e29bcde939e7d9eb59917910e5 Mon Sep 17 00:00:00 2001
From: Raul Tambre <raul at tambre.ee>
Date: Mon, 30 Sep 2024 21:28:23 +0300
Subject: [PATCH] [compiler-rt] Fix C and C++ compilers being switched when
 compiling tests

Fixes: 07317bbc66d1f2d7663af3c9f04d0f6c0487ac03
---
 compiler-rt/cmake/Modules/CompilerRTCompile.cmake | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/compiler-rt/cmake/Modules/CompilerRTCompile.cmake b/compiler-rt/cmake/Modules/CompilerRTCompile.cmake
index 1629db18f1c2d9..447ffd98fe5700 100644
--- a/compiler-rt/cmake/Modules/CompilerRTCompile.cmake
+++ b/compiler-rt/cmake/Modules/CompilerRTCompile.cmake
@@ -73,9 +73,9 @@ function(clang_compile object_file source)
   endif()
   string(REGEX MATCH "[.](cc|cpp)$" is_cxx ${source_rpath})
   if (is_cxx)
-    set(compiler ${COMPILER_RT_TEST_COMPILER})
-  else()
     set(compiler ${COMPILER_RT_TEST_CXX_COMPILER})
+  else()
+    set(compiler ${COMPILER_RT_TEST_COMPILER})
   endif()
   if(COMPILER_RT_STANDALONE_BUILD)
     # Only add global flags in standalone build.



More information about the llvm-commits mailing list