diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2019-03-25 11:35:18 -0700 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2019-03-26 22:17:27 +0200 |
commit | d88bf0eb80e2531a8017de4efd4eb02f1e3081ec (patch) | |
tree | c0459b2f5ef05ca9b510857ab665010f290693ab | |
parent | 31d725555300b04fdc400b6c7002489d7e96efd2 (diff) | |
download | meson-d88bf0eb80e2531a8017de4efd4eb02f1e3081ec.zip meson-d88bf0eb80e2531a8017de4efd4eb02f1e3081ec.tar.gz meson-d88bf0eb80e2531a8017de4efd4eb02f1e3081ec.tar.bz2 |
compilers: n_debug=if-release and buildtype=plain should not enable assertions
It's a bit odd that it doesn't, and has resulted in bugs in distro
packaging.
Fixes #5141
-rw-r--r-- | docs/markdown/snippets/debug-if-release-plain.md | 4 | ||||
-rw-r--r-- | mesonbuild/compilers/compilers.py | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/docs/markdown/snippets/debug-if-release-plain.md b/docs/markdown/snippets/debug-if-release-plain.md new file mode 100644 index 0000000..013e6c8 --- /dev/null +++ b/docs/markdown/snippets/debug-if-release-plain.md @@ -0,0 +1,4 @@ +## n_debug=if-release and buildtype=plain means no asserts + +Previously if this combination was used then assertions were enabled, +which is fairly surprising behavior. diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py index da02980..66195dc 100644 --- a/mesonbuild/compilers/compilers.py +++ b/mesonbuild/compilers/compilers.py @@ -510,7 +510,7 @@ def get_base_compile_args(options, compiler): try: if (options['b_ndebug'].value == 'true' or (options['b_ndebug'].value == 'if-release' and - options['buildtype'].value == 'release')): + options['buildtype'].value in {'release', 'plain'})): args += ['-DNDEBUG'] except KeyError: pass |