When I create a project for visual studio (2015) by using a cmake file, the optimization level is set to O2 by default in release mode.
I am unable to find a way to change this to other values within a cmake file. Additionaly, I would also need a program database (.pdb) to be build.
I tried:
SET(CMAKE_CXX_FLAGS "-O0")
SET(CMAKE_C_FLAGS "-O0")
and
SET(CMAKE_CXX_FLAGS_RELEASE "-O0")
SET(CMAKE_C_FLAGS_RELEASE "-O0")
as proposed here:
https://unix.stackexchange.com/questions/187455/how-to-compile-without-optimizations-o0-using-cmake
without the success. Anybody knows the right way?
SOLVED
clause, you may post answer on your own question. This feature is perfectly fit for your case: please, use it.