I have a project which built by cmake. I want to build it with AddressSanitizer to detect memory leaks. I added these lines into the CMakeLists.txt:
set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=address")
set (CMAKE_LINKER_FLAGS_DEBUG "${CMAKE_STATIC_LINKER_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=address")
But it doesnt work some how (It doesnt show where i have memory leaks). I tested with a test application which definitely contains memory leaks, still nothing happened. Can somebody explain how should i do it ?