On Wed, September 19, 2007 14:32, Bill Hoffman wrote: > Andreas Pakulat wrote: >> Hi, >> >> yesterday I noticed that the Debug buildtype has the same problems as >> the --enable-debug option in autohell. Its not possible to properly >> debug an application that has been built with CMAKE_BUILD_TYPE=Debug. >> At least not with Unix Makefile's (possibly the same applies to MinGW >> Makefile's but I didn't check that). The problem is the compiler flags >> that are set in this build mode: >> >> -g -O2 >> > I don't think that CMake does that. If you do CMAKE_BUILD_TYPE=Debug it > just does > -g. > > IF(CMAKE_COMPILER_IS_GNUCC) > SET (CMAKE_C_FLAGS_INIT "") > SET (CMAKE_C_FLAGS_DEBUG_INIT "-g") > .... > > > Could you be setting -g -O2 in CFLAGS or CXXFLAGS environment > variables before running cmake? > > -Bill > Since we're talking about debug symbols I suggest to take a look at:
http://www.gentoo.org/proj/en/qa/backtraces.xml In short, the preferred way for debugging with gdb/gcc seems to be: -ggdb -O2 _______________________________________________ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake