[CMake] Debug buildtype broken
Bill Hoffman
bill.hoffman at kitware.com
Wed Sep 19 08:32:22 EDT 2007
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
More information about the CMake
mailing list