message: cmake: add ASAN, UBSAN, LSAN options
diff: @@ -65,6 +65,21 @@ if(UNIX AND NOT APPLE)
  add_definitions("-DLINUX")
  endif()
  +if(ASAN)
  + set(CMAKE_C_FLAGS "-fsanitize=address ${CMAKE_C_FLAGS}")
  + set(CMAKE_CXX_FLAGS "-fsanitize=address ${CMAKE_C_FLAGS}")
  +endif()
  +
  +if(UBSAN)
  + set(CMAKE_C_FLAGS "-fsanitize=undefined ${CMAKE_C_FLAGS}")
  + set(CMAKE_CXX_FLAGS "-fsanitize=undefined ${CMAKE_C_FLAGS}")
  +endif()
  +
  +if(LSAN)
  + set(CMAKE_C_FLAGS "-fsanitize=leak ${CMAKE_C_FLAGS}")
  + set(CMAKE_CXX_FLAGS "-fsanitize=leak ${CMAKE_C_FLAGS}")
  +endif()
  +
  set(CMAKE_CXX_FLAGS_COVERAGE "${CMAKE_CXX_FLAGS_COVERAGE} --coverage")
  set(CMAKE_EXE_LINKER_FLAGS_COVERAGE "${CMAKE_EXE_LINKER_FLAGS_COVERAGE} --coverage")
  set(CMAKE_LINKER_FLAGS_COVERAGE "${CMAKE_LINKER_FLAGS_COVERAGE} --coverage")
  