Enable support for KICAD_SANITIZE_ADDRESS CMake flag on MSVC.

(cherry picked from commit d5edde799c)
This commit is contained in:
Alex 2023-06-10 02:09:09 +03:00 committed by dsa-t
parent a348fde7d1
commit 6ad9f25e7d
1 changed files with 6 additions and 0 deletions

View File

@ -483,6 +483,12 @@ if( MSVC )
string( APPEND CMAKE_CXX_FLAGS " /EHs" )
endif()
if( KICAD_SANITIZE_ADDRESS )
add_definitions( -DKICAD_SANITIZE_ADDRESS )
add_definitions( -D_DISABLE_VECTOR_ANNOTATION )
string( APPEND CMAKE_CXX_FLAGS " /fsanitize=address" )
endif()
foreach( type EXE SHARED MODULE)
# /DEBUG: create PDB
string( APPEND CMAKE_${type}_LINKER_FLAGS " /DEBUG /MANIFEST:NO" )