-O2 in Debug build?

Andreas Pakulat apaku at gmx.de
Sat Jul 19 00:23:30 CEST 2008


On 18.07.08 23:06:50, Alexander Neundorf wrote:
> On Friday 18 July 2008, Thiago Macieira wrote:
> > Alexander Neundorf wrote:
> > >On Friday 18 July 2008, Andreas Pakulat wrote:
> > >> Hi,
> > >>
> > >> Whats the reasoning behind using -O2 in the Debug CXX flags? A debug
> > >> build shouldn't use _any_ optimizations IMHO.
> > >
> > >I think there were lengthy discussion about the flags for the different
> > > build types. I guess this was the result.
> > >/me hasn't slept a lot this week, so I don't feel like searching for
> > > this now
> >
> > The reason is that we split the build types in (for gcc):
> >
> > Release
> > 	optimised for speed, qDebug/kDebug turned off, no debug symbols
> > Release with debug info
> > 	optimised for speed, debugging symbols on (-g)
> > Debug
> > 	optimised but debuggable, debugging on (-g)
> > 	(-fno-reorder-blocks -fno-schedule-insns -fno-inline)
> > DebugFull
> > 	no optimisation, full debugging on (-g3)
> > Profile
> > 	DebugFull + -ftest-coverage -fprofile-arcs
> >
> > It is expected that the "Debug" build type be still debuggable with gdb
> > without going all over the place, but still produce better performance.
> > It's also important to note that gcc cannot detect all warning conditions
> > unless the optimiser is active.
> >
> > I'd say that "debug" is recommended for kdelibs for people developing KDE
> > applications, since oftentimes they may have to go into kdelibs
> > functions. Their own code should be build under debugfull while still in
> > development, but should be built a few times in release before a release.
> 
> Thanks for the explanation :-)
> Can you put that on techbase, somewhere related to cmake/building ?

I'm putting it on techbase in a minute (if I find the right spot).
However I'd also like to add the information to FindKDE4Internal.cmake
and more importantly make Debugfull work with CMake 2.6. As I didn't
find a reference of CMAKE_CONFIGURATION_TYPES for cmake 2.4 I've set it
only for 2.6. Please can you have a look at the attached patch and let
me know wether thats ok with you.

Andreas

-- 
A few hours grace before the madness begins again.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: flags_kde4.diff
Type: text/x-diff
Size: 2624 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kde-buildsystem/attachments/20080719/2eb65082/attachment.bin 


More information about the Kde-buildsystem mailing list