Skip to content

Add a new variant for controlling `optimization`

Overall, this allows you to have a pure-debug build (with no optimization enabled) across all BuildTypes.

commit e1fe89d5:

meson.recipe: Backport fix for buildtype bug

commit dc0254dc:

cerbero: Add a new variant for optimization
Now you can pass `-v debug,nooptimization` and it will be the same as
passing `-Dbuildtype=debug` or `-Doptimization=0 -Ddebug=true` to
Meson. Same also applies to non-Meson recipes: `-O2`/`-Os` will be
passed if `optimization` is enabled. If not, `-Og` is passed if
`debug` is enabled, else `-O0` is passed.

This requires revamping how optimization and debug args are added to
compiler flags via env vars. Earlier we used to add them in the
platform-specific config, but this was duplicated across all configs
and was incorrect for Meson recipes.

Note that Meson recipes should not be using `get_option('buildtype')`
in the build files to check if debugging is enabled because that will
return `custom` for most combinations of `optimization` and `debug.

See: https://mesonbuild.com/Builtin-options.html#core-options

commit d5b6ce05:

Backport buildtype patches for various recipes
We set -Ddebug and -Doptimization individually now, so recipes that
check the value of -Dbuildtype are going to be incorrect in many
cases. So, backport patches that I submitted upstream to fix that.

CC: @dabrain34 for !178 (closed)

Merge request reports