Skip to content

Commit 55b71cb

Browse files
committed
Disable C++23 deprecated warnings for MSVC in unit tests.
1 parent 4385162 commit 55b71cb

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

test/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@ function (test_func test_suite_name)
2020
endif ()
2121

2222
cc_cxxtest_add_test (NAME ${name} SRC ${tests} ${valgrand_args})
23+
24+
if ("${CMAKE_CXX_STANDARD}" STREQUAL "23")
25+
# Visual Studio 2025 doesn't seem to properly detect C++23
26+
target_compile_definitions(${name} PRIVATE
27+
$<$<CXX_COMPILER_ID:MSVC>:_SILENCE_ALL_CXX23_DEPRECATION_WARNINGS>
28+
)
29+
endif ()
2330
endfunction ()
2431

2532
#################################################################

0 commit comments

Comments
 (0)