Skip to content

Commit 33e16ca

Browse files
authored
[compiler-rt] Fix CMake configure on Windows (#90843)
CMake configure compiler-rt got broken as a result of following commit: d3925e6 This patch fixes the break by porting the above commit for clang-cl. This problem was not caught on Windows buildbots beacuase it appeared when compiler-rt was included via LLVM_ENABLE_PROJECTS while buildbots include compiler-rt project using LLVM_ENABLE_RUNTIMES flag.
1 parent c129887 commit 33e16ca

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

compiler-rt/cmake/Modules/CompilerRTUtils.cmake

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,11 @@ macro(construct_compiler_rt_default_triple)
369369
endif()
370370

371371
if ("${CMAKE_C_COMPILER_ID}" MATCHES "Clang")
372-
execute_process(COMMAND ${CMAKE_C_COMPILER} --target=${COMPILER_RT_DEFAULT_TARGET_TRIPLE} -print-target-triple
372+
set(option_prefix "")
373+
if (CMAKE_C_SIMULATE_ID MATCHES "MSVC")
374+
set(option_prefix "/clang:")
375+
endif()
376+
execute_process(COMMAND ${CMAKE_C_COMPILER} ${option_prefix}--target=${COMPILER_RT_DEFAULT_TARGET_TRIPLE} ${option_prefix}-print-target-triple
373377
OUTPUT_VARIABLE COMPILER_RT_DEFAULT_TARGET_TRIPLE
374378
OUTPUT_STRIP_TRAILING_WHITESPACE)
375379
endif()

0 commit comments

Comments
 (0)