Skip to content

Commit cad116a

Browse files
committed
Revert "build: improve the builds with Visual Studio"
This reverts commit d9dde28.
1 parent 2f7435d commit cad116a

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

cmake/modules/ClangClCompileRules.cmake

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11

22
# clang-cl interprets paths starting with /U as macro undefines, so we need to
33
# put a -- before the input file path to force it to be treated as a path.
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()
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}")
86

97
# NOTE(compnerd) incremental linking is known to cause corruption in the
108
# protocol conformance tables. Avoid using incremental links with Visual

cmake/modules/SwiftSharedCMakeConfig.cmake

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -258,11 +258,7 @@ endmacro()
258258
macro(swift_common_cxx_warnings)
259259
# Make unhandled switch cases be an error in assert builds
260260
if(DEFINED LLVM_ENABLE_ASSERTIONS)
261-
check_cxx_compiler_flag("-Werror=switch" CXX_SUPPORTS_WERROR_SWITCH_FLAG)
262-
append_if(CXX_SUPPORTS_WERROR_SWITCH_FLAG "-Werror=switch" CMAKE_CXX_FLAGS)
263-
264-
check_cxx_compiler_flag("/we4062" CXX_SUPPORTS_WE4062)
265-
append_if(CXX_SUPPORTS_WE4062 "/we4062" CMAKE_CXX_FLAGS)
261+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=switch")
266262
endif()
267263

268264
check_cxx_compiler_flag("-Werror -Wdocumentation" CXX_SUPPORTS_DOCUMENTATION_FLAG)

0 commit comments

Comments
 (0)