Skip to content

Commit 77cecb1

Browse files
committed
COMP: Suppress deprecated warnings in MSVC wrapping builds
Add /wd4996 to MSVC compile flags for SWIG-generated Python wrapper targets. This suppresses C4996 warnings triggered by deprecated VariableLengthVector::AllocateElements calls in auto-generated wrapper code. GCC/Clang wrapping builds already suppress all warnings with -w.
1 parent 1d0305e commit 77cecb1

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

Wrapping/macro_files/itk_end_wrap_module.cmake

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -527,12 +527,13 @@ ${DO_NOT_WAIT_FOR_THREADS_CALLS}
527527
)
528528
else()
529529
if(MSVC)
530-
# Disables 'conversion from 'type1' to 'type2', possible loss of data warnings
530+
# /wd4244: Disables 'conversion from 'type1' to 'type2', possible loss of data warnings
531+
# /wd4996: Disables deprecated declaration warnings in generated wrapper code
531532
set_target_properties(
532533
${lib}
533534
PROPERTIES
534535
COMPILE_FLAGS
535-
"/wd4244"
536+
"/wd4244 /wd4996"
536537
)
537538
endif()
538539
target_link_directories(${lib} PUBLIC ${Python3_LIBRARY_DIRS})

0 commit comments

Comments
 (0)