[arch-dev-public] RFC: Dropping -DCMAKE_BUILD_TYPE from packages using cmake

Baptiste Jonglez baptiste at bitsofnetworks.org
Thu Apr 12 20:42:59 UTC 2018


Hi,

On 10-03-18, Antonio Rojas via arch-dev-public wrote:
>  Currently most of our packages which use the cmake build system are built with -DCMAKE_BUILD_TYPE=Release. This provides a reasonable (according to upstream) set of C(XX)FLAGS defaults which are appended to and override our default C(XX)FLAGS. So, for instance, our cmake packages are being built with -O3 instead of our default -O2. Besides the inconsistency that this brings to our binaries, IMO it's not a good idea to override our default C(XX)FLAGS unless there's a good reason to. This will also cause issues once we start building debug packages by default (-DCMAKE_BUILD_TYPE=Release also adds DNDEBUG).
>  Therefore I'm proposing to drop -DCMAKE_BUILD_TYPE from all our cmake packages, building them with our default C(XX)FLAGS as all other packages. Comments?

This sounds like a good idea, with a small caveat: I have seen a few
projects implement some form of:

  if (NOT CMAKE_BUILD_TYPE)
      set(CMAKE_BUILD_TYPE Release)
  endif ()

That is, for these projects, CMAKE_BUILD_TYPE defaults to "Release" if not set.

Thus, I suggest we explicitely set the build type to "None" instead.

Baptiste
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.archlinux.org/pipermail/arch-dev-public/attachments/20180412/d9ad7ad9/attachment.asc>


More information about the arch-dev-public mailing list