Skip to content

Commit b60945f

Browse files
committed
[CMake] Use correct compiler flag for unoptimized MSVC/clang-cl builds
1 parent 25722bb commit b60945f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

cmake/modules/AddSwift.cmake

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,11 @@ function(_add_variant_c_compile_flags)
186186
list(APPEND result "-momit-leaf-frame-pointer")
187187
endif()
188188
else()
189-
list(APPEND result "-O0")
189+
if(NOT SWIFT_COMPILER_IS_MSVC_LIKE)
190+
list(APPEND result "-O0")
191+
else()
192+
list(APPEND result "/Od")
193+
endif()
190194
endif()
191195

192196
# CMake automatically adds the flags for debug info if we use MSVC/clang-cl.

0 commit comments

Comments
 (0)