Skip to content

Commit

Permalink
Merge pull request swiftlang#19279 from compnerd/msbuild
Browse files Browse the repository at this point in the history
  • Loading branch information
swift-ci authored Sep 12, 2018
2 parents c4a6a09 + d9dde28 commit 004d0b9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 4 additions & 2 deletions cmake/modules/ClangClCompileRules.cmake
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@

# clang-cl interprets paths starting with /U as macro undefines, so we need to
# put a -- before the input file path to force it to be treated as a path.
string(REPLACE "-c <SOURCE>" "-c -- <SOURCE>" CMAKE_C_COMPILE_OBJECT "${CMAKE_C_COMPILE_OBJECT}")
string(REPLACE "-c <SOURCE>" "-c -- <SOURCE>" CMAKE_CXX_COMPILE_OBJECT "${CMAKE_CXX_COMPILE_OBJECT}")
if(NOT MSVC AND "${CMAKE_SIMULATE_ID}" STREQUAL "MSVC")
string(REPLACE "-c <SOURCE>" "-c -- <SOURCE>" CMAKE_C_COMPILE_OBJECT "${CMAKE_C_COMPILE_OBJECT}")
string(REPLACE "-c <SOURCE>" "-c -- <SOURCE>" CMAKE_CXX_COMPILE_OBJECT "${CMAKE_CXX_COMPILE_OBJECT}")
endif()

# NOTE(compnerd) incremental linking is known to cause corruption in the
# protocol conformance tables. Avoid using incremental links with Visual
Expand Down
6 changes: 5 additions & 1 deletion cmake/modules/SwiftSharedCMakeConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,11 @@ endmacro()
macro(swift_common_cxx_warnings)
# Make unhandled switch cases be an error in assert builds
if(DEFINED LLVM_ENABLE_ASSERTIONS)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=switch")
check_cxx_compiler_flag("-Werror=switch" CXX_SUPPORTS_WERROR_SWITCH_FLAG)
append_if(CXX_SUPPORTS_WERROR_SWITCH_FLAG "-Werror=switch" CMAKE_CXX_FLAGS)

check_cxx_compiler_flag("/we4062" CXX_SUPPORTS_WE4062)
append_if(CXX_SUPPORTS_WE4062 "/we4062" CMAKE_CXX_FLAGS)
endif()

check_cxx_compiler_flag("-Werror -Wdocumentation" CXX_SUPPORTS_DOCUMENTATION_FLAG)
Expand Down

0 comments on commit 004d0b9

Please sign in to comment.