From ca03ecf3e6aa62070676487eb413abb563322f86 Mon Sep 17 00:00:00 2001 From: Shauren Date: Tue, 22 Aug 2023 12:56:13 +0200 Subject: Build: Support ASAN on msvc (cherry picked from commit 0a0b420d866f070d4b1208bb3c4451398797c6ef) --- cmake/compiler/msvc/settings.cmake | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'cmake/compiler') diff --git a/cmake/compiler/msvc/settings.cmake b/cmake/compiler/msvc/settings.cmake index f6947d6eaad..96b79ac2683 100644 --- a/cmake/compiler/msvc/settings.cmake +++ b/cmake/compiler/msvc/settings.cmake @@ -151,6 +151,19 @@ target_compile_options(trinity-compile-option-interface /we4263 /we4264) +if(ASAN) + target_compile_definitions(trinity-compile-option-interface + INTERFACE + -D_DISABLE_STRING_ANNOTATION + -D_DISABLE_VECTOR_ANNOTATION) + + target_compile_options(trinity-compile-option-interface + INTERFACE + /fsanitize=address) + + message(STATUS "MSVC: Enabled Address Sanitizer ASan") +endif() + # Disable incremental linking in debug builds. # To prevent linking getting stuck (which might be fixed in a later VS version). macro(DisableIncrementalLinking variable) -- cgit v1.2.3