File tree 2 files changed +9
-3
lines changed
2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change 1
1
2
2
# clang-cl interprets paths starting with /U as macro undefines, so we need to
3
3
# put a -- before the input file path to force it to be treated as a path.
4
- string (REPLACE "-c <SOURCE>" "-c -- <SOURCE>" CMAKE_C_COMPILE_OBJECT "${CMAKE_C_COMPILE_OBJECT} " )
5
- string (REPLACE "-c <SOURCE>" "-c -- <SOURCE>" CMAKE_CXX_COMPILE_OBJECT "${CMAKE_CXX_COMPILE_OBJECT} " )
4
+ if (NOT MSVC AND "${CMAKE_SIMULATE_ID} " STREQUAL "MSVC" )
5
+ string (REPLACE "-c <SOURCE>" "-c -- <SOURCE>" CMAKE_C_COMPILE_OBJECT "${CMAKE_C_COMPILE_OBJECT} " )
6
+ string (REPLACE "-c <SOURCE>" "-c -- <SOURCE>" CMAKE_CXX_COMPILE_OBJECT "${CMAKE_CXX_COMPILE_OBJECT} " )
7
+ endif ()
6
8
7
9
# NOTE(compnerd) incremental linking is known to cause corruption in the
8
10
# protocol conformance tables. Avoid using incremental links with Visual
Original file line number Diff line number Diff line change @@ -270,7 +270,11 @@ endmacro()
270
270
macro (swift_common_cxx_warnings)
271
271
# Make unhandled switch cases be an error in assert builds
272
272
if (DEFINED LLVM_ENABLE_ASSERTIONS)
273
- set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=switch" )
273
+ check_cxx_compiler_flag("-Werror=switch" CXX_SUPPORTS_WERROR_SWITCH_FLAG)
274
+ append_if(CXX_SUPPORTS_WERROR_SWITCH_FLAG "-Werror=switch" CMAKE_CXX_FLAGS )
275
+
276
+ check_cxx_compiler_flag("/we4062" CXX_SUPPORTS_WE4062)
277
+ append_if(CXX_SUPPORTS_WE4062 "/we4062" CMAKE_CXX_FLAGS )
274
278
endif ()
275
279
276
280
check_cxx_compiler_flag("-Werror -Wdocumentation" CXX_SUPPORTS_DOCUMENTATION_FLAG)
You can’t perform that action at this time.
0 commit comments