Build in CMake with these params:
CMAKE_CXX_FLAGS:STRING= -fsanitize=address -fsanitize=leak -g
CMAKE_C_FLAGS:STRING=-fsanitize=address -fsanitize=leak -g
CMAKE_EXE_LINKER_FLAGS:STRING=-fsanitize=address -fsanitize=leak
CMAKE_MODULE_LINKER_FLAGS:STRING=-fsanitize=address -fsanitize=leak
Which can be done with: