File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -96,6 +96,12 @@ macro(swift_swap_compiler_if_needed target)
9696 set (CMAKE_C_COMPILER ${CLANG_LOCATION} /clang${CMAKE_EXECUTABLE_SUFFIX} )
9797 set (CMAKE_CXX_COMPILER ${CLANG_LOCATION} /clang++${CMAKE_EXECUTABLE_SUFFIX} )
9898 endif ()
99+
100+ # Add a workaround for older clang-cl with a newer MSVC runtime. MSVC
101+ # 16.27 ships with a C++ compiler that enables conditional explicit from
102+ # C++20 unconditionally. Newer clang supports this, but the 5.3 release
103+ # branch clang does not. Add a workaround.
104+ add_compile_definitions ($<$<OR :$<COMPILE_LANGUAGE:C>,$<COMPILE_LANGUAGE:CXX>>:_HAS_CONDITIONAL_EXPLICIT=0>)
99105 else ()
100106 message (SEND_ERROR "${target} requires a clang based compiler" )
101107 endif ()
Original file line number Diff line number Diff line change @@ -55,6 +55,12 @@ else()
5555 add_compile_options (-fno-sanitize=all )
5656endif ()
5757
58+ # Add a workaround for older clang-cl with a newer MSVC runtime. MSVC 16.27
59+ # ships with a C++ compiler that enables conditional explicit from C++20
60+ # unconditionally. Newer clang supports this, but the 5.3 release branch clang
61+ # does not. Add a workaround.
62+ add_compile_definitions ($<$<OR :$<COMPILE_LANGUAGE:C>,$<COMPILE_LANGUAGE:CXX>>:_HAS_CONDITIONAL_EXPLICIT=0>)
63+
5864# Do not enforce checks for LLVM's ABI-breaking build settings.
5965# The Swift runtime uses some header-only code from LLVM's ADT classes,
6066# but we do not want to link libSupport into the runtime. These checks rely
You can’t perform that action at this time.
0 commit comments