Skip to content

Commit 0cfb54d

Browse files
committed
stdlib: make cl based compilation reasonable
`-Wall` with the clang-cl interface gives us `-Weverything` effectively, which really reduces the effectiveness of the warnings. Switch to `/W3` which is roughly equivalent to `-Wall` in clang mode.
1 parent 1f1e523 commit 0cfb54d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

stdlib/public/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@ list(APPEND SWIFT_RUNTIME_SWIFT_COMPILE_FLAGS "-Xfrontend" "-verify-syntax-tree"
1818

1919
# Build the runtime with -Wall to catch, e.g., uninitialized variables
2020
# warnings.
21-
list(APPEND SWIFT_RUNTIME_CXX_FLAGS "-Wall")
21+
if(SWIFT_COMPILER_IS_MSVC_LIKE)
22+
list(APPEND SWIFT_RUNTIME_CXX_FLAGS "/W3")
23+
else()
24+
list(APPEND SWIFT_RUNTIME_CXX_FLAGS "-Wall")
25+
endif()
2226

2327
set(SWIFT_RUNTIME_CORE_CXX_FLAGS "${SWIFT_RUNTIME_CXX_FLAGS}")
2428
set(SWIFT_RUNTIME_CORE_LINK_FLAGS "${SWIFT_RUNTIME_LINK_FLAGS}")

0 commit comments

Comments
 (0)