#compile with warnings if(WIN32) add_compile_options(/W4 /WX "$<$:/MTd>") else() add_compile_options(-Wall -Wextra -pedantic -Werror) endif() #enable asan in debug if(WIN32) add_compile_options("$<$:-fsanitize=address>") else() add_compile_options("$<$:-fsanitize=address>") add_link_options("$<$:-fsanitize=address>") endif() #enable ubsan in debug if(NOT WIN32) add_compile_options("$<$:-fsanitize=undefined>" "$<$:-fno-omit-frame-pointer>") add_link_options("$<$:-fsanitize=undefined>") endif()