Skip to content

Instantly share code, notes, and snippets.

@esnosy
Last active October 1, 2023 18:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save esnosy/f2c762ab3c811e88c404613182676ffb to your computer and use it in GitHub Desktop.
Save esnosy/f2c762ab3c811e88c404613182676ffb to your computer and use it in GitHub Desktop.
CMake snipped to enable ASAN for MSVC and non-MSVC in Debug config correctly 😊
if(MSVC)
target_compile_options(eigen_vis_cpp PRIVATE $<$<CONFIG:RelWithDebInfo,Debug>:/fsanitize=address>)
elseif()
target_compile_options(eigen_vis_cpp PRIVATE $<$<CONFIG:RelWithDebInfo,Debug>:-fsanitize=address -fno-omit-frame-pointer>)
target_link_options(eigen_vis_cpp PRIVATE $<$<CONFIG:RelWithDebInfo,Debug>-fsanitize=address>)
endif()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment