Disable incremental linking in msvc when sanitizers are enabled.
@@ -235,13 +235,17 @@ if(WIN32 AND MSVC)
# Sanitizers
if(OPTION_BUILD_THREAD_SANITIZER AND (CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo"))
add_compile_options(/fsanitize=thread)
+ add_link_options(/INCREMENTAL:NO)
elseif(OPTION_BUILD_SANITIZER AND (CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo"))
add_compile_options(/fsanitize=address)
+ add_link_options(/INCREMENTAL:NO)
elseif(OPTION_BUILD_MEMORY_SANITIZER AND (CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo"))
add_compile_options(/fsanitize=memory)
add_compile_options(/fsanitize=leak)
+ add_link_options(/INCREMENTAL:NO)
elseif(OPTION_BUILD_UB_SANITIZER AND (CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo"))
add_compile_options(/fsanitize=undefined)
+ add_link_options(/INCREMENTAL:NO)
endif()
endif()
