Remove forced /Od flag in MSVC Release build. (#5216)

Add /wd4702 to disable warning C4702: unreachable code in MSVC Release build.

Signed-off-by: Richard Musil <risa2000x@gmail.com>
Co-authored-by: Richard Musil <risa2000x@gmail.com>
This commit is contained in:
risa2000
2026-06-28 17:39:07 +02:00
committed by GitHub
parent 25c58ac6bd
commit c37f82e563
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -63,12 +63,12 @@ target_compile_definitions(test_main PUBLIC
JSON_TEST_USING_MULTIPLE_HEADERS=$<BOOL:${JSON_MultipleHeaders}>)
target_compile_features(test_main PRIVATE cxx_std_11)
target_compile_options(test_main PUBLIC
$<$<CXX_COMPILER_ID:MSVC>:/EHsc;$<$<CONFIG:Release>:/Od>>
$<$<CXX_COMPILER_ID:MSVC>:/EHsc>
# MSVC: Force to always compile with W4
# Disable warning C4566: character represented by universal-character-name '\uFF01'
# cannot be represented in the current code page (1252)
# Disable warning C4996: 'nlohmann::basic_json<...>::operator <<': was declared deprecated
$<$<CXX_COMPILER_ID:MSVC>:/W4 /wd4566 /wd4996>
$<$<CXX_COMPILER_ID:MSVC>:/W4;/wd4566;/wd4996;$<$<CONFIG:Release>:/wd4702>>
# https://github.com/nlohmann/json/issues/1114
$<$<CXX_COMPILER_ID:MSVC>:/bigobj> $<$<BOOL:${MINGW}>:-Wa,-mbig-obj>
+2 -2
View File
@@ -5,9 +5,9 @@ target_compile_definitions(abi_compat_common INTERFACE
JSON_TEST_KEEP_MACROS)
target_compile_features(abi_compat_common INTERFACE cxx_std_11)
target_compile_options(abi_compat_common INTERFACE
$<$<CXX_COMPILER_ID:MSVC>:/EHsc;$<$<CONFIG:Release>:/Od>>
$<$<CXX_COMPILER_ID:MSVC>:/EHsc>
# MSVC: Force to always compile with W4
$<$<CXX_COMPILER_ID:MSVC>:/W4>
$<$<CXX_COMPILER_ID:MSVC>:/W4;$<$<CONFIG:Release>:/wd4702>>
# https://github.com/nlohmann/json/pull/3229
$<$<CXX_COMPILER_ID:Intel>:-diag-disable=2196>