[CMake] Visual Studio: release builds with "Generate Debug Info" enabled

John Drescher drescherjm at gmail.com
Tue Jun 2 16:05:39 EDT 2009


On Tue, Jun 2, 2009 at 3:54 PM, Tyler Roscoe <tyler at cryptio.net> wrote:
> We build the Release versions of our libraries with Debug info enabled.
>
> In Visual Studio, you enable this by setting
> Properties->Linker->Debugging->Generate Debug Info to Yes.
>
> All this really does is add /DEBUG to the link flags for the library.
>
> So I added "/DEBUG" to the LINK_FLAGS_RELEASE property for that library.
> This does the right thing, and objdump verifies that the libraries are
> generated correctly.
>
> The trouble is that setting this flag doesn't update the dropdown box in
> Properties->Linker->Debugging. Some diffing shows that selecting Yes in
> the dropdown sets a flag in the .vcproj,
> GenerateDebugInformation="true".
>
> Is there a way to set this flag from CMake? A developer could get
> confused and think debug info is not being generated even though it
> really is.
>
> Maybe the VS Generator could change the GenerateDebugInformation flag if
> /DEBUG is present in the link flags?
>

How about using the RelWithDebInfo build that CMake generates?

John


More information about the CMake mailing list