Skip to content

Commit 2257414

Browse files
committed
Fix disabling optimizations on Debug builds
Use /Od on MSVC and use our helper macro to detect support for the flags, this avoid warnings on MSVC since it doesn't understand -O0.
1 parent ff5cbb8 commit 2257414

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@ if(CMAKE_SYSTEM_NAME STREQUAL "WASI")
8888
endif()
8989

9090
if(CMAKE_BUILD_TYPE MATCHES "Debug")
91-
add_compile_options(-O0)
91+
xcheck_add_c_compiler_flag(/Od)
92+
xcheck_add_c_compiler_flag(-O0)
9293
xcheck_add_c_compiler_flag(-ggdb)
9394
xcheck_add_c_compiler_flag(-fno-omit-frame-pointer)
9495
endif()

0 commit comments

Comments
 (0)