File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 1
1
if (("${SWIFT_HOST_VARIANT_SDK} " STREQUAL "${SWIFT_PRIMARY_VARIANT_SDK} " ) AND
2
2
("${SWIFT_HOST_VARIANT_ARCH} " STREQUAL "${SWIFT_PRIMARY_VARIANT_ARCH} " ))
3
3
4
+ if (SWIFT_BUILD_RUNTIME_WITH_HOST_COMPILER )
5
+ if (NOT "${CMAKE_C_COMPILER_ID} " MATCHES "Clang" )
6
+ message (FATAL_ERROR "Building the swift runtime is not supported with ${CMAKE_C_COMPILER_ID} . Use the just-built clang instead." )
7
+ else ()
8
+ message (WARNING "Building the swift runtime using the host compiler, and not the just-built clang." )
9
+ endif ()
10
+ else ()
11
+ # If we use Clang-cl or MSVC, CMake provides default compiler and linker flags that are incompatible
12
+ # with the frontend of Clang or Clang++.
13
+ if (SWIFT_COMPILER_IS_MSVC_LIKE )
14
+ set (CMAKE_CXX_COMPILER "${SWIFT_NATIVE_LLVM_TOOLS_PATH} /clang-cl" )
15
+ set (CMAKE_C_COMPILER "${SWIFT_NATIVE_LLVM_TOOLS_PATH} /clang-cl" )
16
+ else ()
17
+ set (CMAKE_CXX_COMPILER "${SWIFT_NATIVE_LLVM_TOOLS_PATH} /clang++" )
18
+ set (CMAKE_C_COMPILER "${SWIFT_NATIVE_LLVM_TOOLS_PATH} /clang" )
19
+ endif ()
20
+
21
+ set (CMAKE_C_COMPILER_LAUNCHER "" )
22
+ set (CMAKE_CXX_COMPILER_LAUNCHER "" )
23
+ endif ()
24
+
4
25
set (swift_runtime_test_extra_libraries )
5
26
if (SWIFT_BUILD_STATIC_STDLIB AND "${SWIFT_HOST_VARIANT_SDK} " STREQUAL "LINUX" )
6
27
list (APPEND swift_runtime_test_extra_libraries
You can’t perform that action at this time.
0 commit comments