Having a Tier 0 for cmake and git submodules

David Faure faure at kde.org
Sun Nov 10 18:57:10 UTC 2013


On Sunday 10 November 2013 18:23:33 Sune Vuorela wrote:
> DCMAKE_BUILD_TYPE=Debug is building with -O2

Oh wow, I always thought this was cmake's doing, but you're right, it's not. 
This is an historical bit from the automake/unsermake times.

We had debug (-O2 -g) and debugfull (no optimization, and -g3).
So that's what we kept in kdelibs for kde4, and now it made it to ECM.

But cmake already has both, just with different names!

cmake has -O2 -g, it calls it RelWithDebInfo.

And it almost has the last one, called Debug, it's just missing -g3
(== macro expansion in gdb, not a huge deal, could even be added to cmake I 
guess).

So unless I'm missing something, let's just kill the KDE renaming, and use the 
upstream names for things.

OK, in fact KDECompilerSettings makes a small difference between 
RelWithDebInfo and what it calls Debug: Debug also has "-fno-reorder-blocks -
fno-schedule-insns -fno-inline". So you simplified things a little bit when 
you said "Debug is building with -O2" -- yes, but some optimizations are 
disabled, such as inlining which makes gdb usage a pain. So it's not a full 
O2. However.... I don't see a need for this, to be honest.

RelWithDebInfo is fine for distros and for profiling, and for kde developers 
who don't expect to do a lot of step-by-step debugging in the apps they only 
use.
cmake's Debug is the one to use when you expect to do that.

So ECM's "Debug" with "some optimizations but not all of them" doesn't seem 
very useful.

Note that KDECompilerSettings does set extra flags that we want, such as 
warnings (e.g.  -Werror=return-type catches some nasty code sometimes).
So that should stay, but it's build-type-unrelated and could be called 
ECMStricterCompilerFlags or something.

-- 
David Faure, faure at kde.org, http://www.davidfaure.fr
Working on KDE, in particular KDE Frameworks 5



More information about the Kde-frameworks-devel mailing list