Skip to content

Commit a28154d

Browse files
Revert "Revert " [runtime] unittests should use just-built compiler if the ru…"
1 parent e5800f1 commit a28154d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

unittests/runtime/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ if(("${SWIFT_HOST_VARIANT_SDK}" STREQUAL "${SWIFT_PRIMARY_VARIANT_SDK}") AND
22
("${SWIFT_HOST_VARIANT_ARCH}" STREQUAL "${SWIFT_PRIMARY_VARIANT_ARCH}"))
33

44
if("${CMAKE_C_COMPILER_ID}" MATCHES "Clang")
5-
# Do nothing
5+
if(NOT SWIFT_BUILD_RUNTIME_WITH_HOST_COMPILER)
6+
set(CMAKE_CXX_COMPILER "${SWIFT_NATIVE_CLANG_TOOLS_PATH}/clang++")
7+
set(CMAKE_C_COMPILER "${SWIFT_NATIVE_CLANG_TOOLS_PATH}/clang")
8+
endif()
69
elseif(SWIFT_BUILD_RUNTIME_WITH_HOST_COMPILER)
710
if(NOT "${CMAKE_C_COMPILER_ID}" MATCHES "Clang")
811
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)