From c37f82e5630c6a36b37b995896e1523c1d1f0654 Mon Sep 17 00:00:00 2001 From: risa2000 <1336835+risa2000@users.noreply.github.com> Date: Sun, 28 Jun 2026 17:39:07 +0200 Subject: [PATCH] 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 Co-authored-by: Richard Musil --- tests/CMakeLists.txt | 4 ++-- tests/abi/CMakeLists.txt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index b1dc5df10..2620d9655 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -63,12 +63,12 @@ target_compile_definitions(test_main PUBLIC JSON_TEST_USING_MULTIPLE_HEADERS=$) target_compile_features(test_main PRIVATE cxx_std_11) target_compile_options(test_main PUBLIC - $<$:/EHsc;$<$:/Od>> + $<$:/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 - $<$:/W4 /wd4566 /wd4996> + $<$:/W4;/wd4566;/wd4996;$<$:/wd4702>> # https://github.com/nlohmann/json/issues/1114 $<$:/bigobj> $<$:-Wa,-mbig-obj> diff --git a/tests/abi/CMakeLists.txt b/tests/abi/CMakeLists.txt index ba90837cb..542409977 100644 --- a/tests/abi/CMakeLists.txt +++ b/tests/abi/CMakeLists.txt @@ -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 - $<$:/EHsc;$<$:/Od>> + $<$:/EHsc> # MSVC: Force to always compile with W4 - $<$:/W4> + $<$:/W4;$<$:/wd4702>> # https://github.com/nlohmann/json/pull/3229 $<$:-diag-disable=2196>