[Exherbo-dev] Set CMake build type as build_option

Bernd Steinhauser exherbo at bernd-steinhauser.de
Wed Jun 1 17:22:06 UTC 2016


On 16/04/16 12:39, Niels Ole Salscheider wrote:
> Hello,
>
> currently, we set the CMAKE_BUILD_TYPE to "None". The reason for this is that
> CMake has CMAKE_C{,XX}_FLAGS variables where the corresponding build flags can
> be passed. When the build type is "None", only these flags are used. If the
> build type is however set to anything else, then the flags from CMAKE_C{,XX}
> _FLAGS_$TYPE will be appended to the former.
>
> This seems to make sense because the additional variables contain flags that we
> don't want. CMAKE_CXX_FLAGS_RELEASE, for example, defaults to "-O3 -DNDEBUG"
> and we don't want the -O3 flag.
> But the "None" type is not really supported and some projects (e. g. LLVM)
> even forbid it. Apart from that projects might add additional flags to these
> variables. They could for example add defines that enable some debug code only
> in debug builds.
>
> It would therefore make sense to set the build type to the right value so that
> these flags can be included. In that case we would also have to set the default
> values of all CMAKE_C{,XX}_FLAGS_$TYPE variables to sensible values that do
> not include any -O flags. CMAKE_CXX_FLAGS_RELEASE would for example only
> contain "-DNDEBUG".
>
> Bernd Steinhauser proposed that we should set the CMake build type based on a
> build_option. What do you think?

Any more opinions on this stuff? I would like to reach a decision here.



More information about the Exherbo-dev mailing list