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)
96
96
set (CMAKE_C_COMPILER ${CLANG_LOCATION} /clang${CMAKE_EXECUTABLE_SUFFIX} )
97
97
set (CMAKE_CXX_COMPILER ${CLANG_LOCATION} /clang++${CMAKE_EXECUTABLE_SUFFIX} )
98
98
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> )
99
105
else ()
100
106
message (SEND_ERROR "${target} requires a clang based compiler" )
101
107
endif ()
Original file line number Diff line number Diff line change @@ -55,6 +55,12 @@ else()
55
55
add_compile_options (-fno-sanitize=all )
56
56
endif ()
57
57
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
+
58
64
# Do not enforce checks for LLVM's ABI-breaking build settings.
59
65
# The Swift runtime uses some header-only code from LLVM's ADT classes,
60
66
# 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