Skip to content
Snippets Groups Projects
Gaël Bonithon's avatar
Gaël Bonithon authored
We can't just rely on the `buildtype` option to decide which flags to
add, as the user can directly set the `debug` and `optimization`
options, which usually result in a `buildtype` option set to `custom`.
It also seems that `buildtype=debugoptimized` corresponds to a
production build, for which we shouldn't enable debug logs (see
reference below).

This doesn't exactly reproduce the autotools build mode of the
`--enable-debug` option, which we should probably accept having to
deviate from:
* `--enable-debug={full,yes}` are mixed up in the same debug mode, where
  all debug logs are enabled (which is perhaps no bad thing?). This
  corresponds to `buildtype=debug`.
* `--enable-debug=minimal` corresponds to `buildtype=debugoptimized`,
  where no flag is set.
* `--enable-debug=no` corresponds to `buildtype={minsize,release}`,
  where we set aggressive optimization flags.
* `buildtype=plain` is also a production mode, for which we don't set
  debug flags, but for which we don't really know the optimization mode,
  so we don't set aggressive optimization flags either.

Related: !98
See-also:
https://blogs.gnome.org/mcatanzaro/2022/07/15/best-practices-for-build-options/
https://mesonbuild.com/Builtin-options.html
0b950ed6
History
Name Last commit Last update