Skip to content
Discussion options

You must be logged in to vote

Meson doesn't support setting global options inside the build definitions, since it mixes policy with build logic. The easiest way to handle this is to use a set of profile configurations:

debug.ini:
``ini
[built-in options]
buildtype = 'debug'
b_sanitize = 'address,undefined'

and release.ini:
```ini
[built-in options]
werror=true

then have a profiles/ directory, you can run meson setup builddir/debug --native-file profiles/debug.ini and meson setup builddir/release --native-file profiles/release.ini

As an aside, I've had to professionally deal with third party code that mixes policy and logic like this, and as the downstream having to carry patches to pull that kind of policy out to get…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@janvhs
Comment options

Answer selected by janvhs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants