Skip to content

Commit 2414958

Browse files
authored
Merge pull request #85421 from compnerd/driver
build: use the correct driver for building the unit tests
2 parents fb62a85 + c0d286c commit 2414958

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

unittests/runtime/CMakeLists.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,13 @@ if(("${SWIFT_HOST_VARIANT_SDK}" STREQUAL "${SWIFT_PRIMARY_VARIANT_SDK}") AND
88

99
if("${CMAKE_C_COMPILER_ID}" MATCHES "Clang")
1010
if(NOT SWIFT_BUILD_RUNTIME_WITH_HOST_COMPILER)
11-
set(CMAKE_CXX_COMPILER "${SWIFT_NATIVE_CLANG_TOOLS_PATH}/clang++")
12-
set(CMAKE_C_COMPILER "${SWIFT_NATIVE_CLANG_TOOLS_PATH}/clang")
11+
if(SWIFT_COMPILER_IS_MSVC_LIKE)
12+
set(CMAKE_CXX_COMPILER "${SWIFT_NATIVE_CLANG_TOOLS_PATH}/clang-cl")
13+
set(CMAKE_C_COMPILER "${SWIFT_NATIVE_CLANG_TOOLS_PATH}/clang-cl")
14+
else()
15+
set(CMAKE_CXX_COMPILER "${SWIFT_NATIVE_CLANG_TOOLS_PATH}/clang++")
16+
set(CMAKE_C_COMPILER "${SWIFT_NATIVE_CLANG_TOOLS_PATH}/clang")
17+
endif()
1318
endif()
1419
elseif(SWIFT_BUILD_RUNTIME_WITH_HOST_COMPILER)
1520
message(FATAL_ERROR "Building the swift runtime is not supported with ${CMAKE_C_COMPILER_ID}. Use the just-built clang instead.")

0 commit comments

Comments
 (0)