Skip to content

Commit 7458048

Browse files
committed
Fix msvc address sanitizer link
Recently string annotations were added in msvc asan builds. For [cmake] -- The CXX compiler identification is MSVC 19.34.31721.0 I get error [build] docopt.lib(docopt.obj) : error LNK2038: mismatch detected for 'annotate_string': value '0' doesn't match value '1' in main.cpp.obj [...] [build] src\travels.exe : fatal error LNK1319: 44 mismatches detected We can simply disable the string annotations just like the vector annotations
1 parent 789c685 commit 7458048

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ target_compile_features(project_options INTERFACE cxx_std_${CMAKE_CXX_STANDARD})
115115

116116
# We don't have any way of ensuring that all static dependencies are compiled with
117117
# address sanitizer enabled.
118-
target_compile_definitions(project_options INTERFACE _DISABLE_VECTOR_ANNOTATION)
118+
target_compile_definitions(project_options INTERFACE _DISABLE_VECTOR_ANNOTATION _DISABLE_STRING_ANNOTATION)
119119

120120
# configure files based on CMake configuration options
121121
add_subdirectory(configured_files)

0 commit comments

Comments
 (0)