Review Request 113805: Do not change the build types available with cmake

Alexander Neundorf neundorf at kde.org
Tue Nov 12 19:24:08 UTC 2013


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/113805/#review43538
-----------------------------------------------------------


IMO the patch as it is is not good.

Several things:
1) This file, is not mandatory at all with KDE frameworks.
You can build applications using KDE frameworks libraries without it. You (the developer of the application) simply has to not-load the file KDECompilerSettings.
If the developer has decided to load this file, it is not surprising that he gets modified compiler flags, because this is what he decided to do.

2) You removed e.g. the flags for the build types COVERAGE and PROFILE. CMake doesn't provide these build types or flags itself, so the patch removes support for these buildtypes. I don't see the need to remove support for profile or coverage builds. CMake itself comes with "debug", "minsizerel", "release" and "relwithdebinfo".

3) You remove the flags for Linux and/or gcc. Why didn't you remove them for other compilers/operating systems ?


I know that what we are doing in this file is not the cmake-recommended way.
>From cmake, the variables for the flags are cache variables which are set to some default. The idea is that the person who compiles some package can adjust them to his liking. This is from my experience not what we expect from the average KDE contributor. He should get a working set up, with known compiler flags so it is easy to fix buid bugs (or avoid them in the first place).
By simply setting the normal (non-cache) variables, the person building the package can set the cache variables to whatever he wants, it will be overridden to what is set in KDECompilerSettings.cmake.
Maybe the way this is done could be improved by doing something like
if(NOT DEFINED SOME_CXX_FLAGS_ALREADY_PRESET)
   set(SOME_CXX_FLAGS_ALREADY_PRESET TRUE CACHE BOOL "docs..." )
   set(SOME_CXX_FLAGS "--some-flag --another-flag" CACHE STRING "docs..." FORCE)
endif()

This way it would be only on the initial cmake run forced into the cache, and afterwards the user should be able to change them as he wants.




- Alexander Neundorf


On Nov. 11, 2013, 10:16 p.m., Sune Vuorela wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/113805/
> -----------------------------------------------------------
> 
> (Updated Nov. 11, 2013, 10:16 p.m.)
> 
> 
> Review request for Build System and KDE Frameworks.
> 
> 
> Repository: extra-cmake-modules
> 
> 
> Description
> -------
> 
> Do not change the build types available with cmake.
> 
> 
> Diffs
> -----
> 
>   kde-modules/KDECompilerSettings.cmake b034751a5be8073f9628971b552faa079c64e8b6 
> 
> Diff: http://git.reviewboard.kde.org/r/113805/diff/
> 
> 
> Testing
> -------
> 
> Built kdelibs on linux with gcc.
> 
> 
> Thanks,
> 
> Sune Vuorela
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-buildsystem/attachments/20131112/d990e904/attachment.html>


More information about the Kde-buildsystem mailing list