Blame 0001-compilers-n_debug-if-release-and-buildtype-plain-sho.patch

741aa32
From d88bf0eb80e2531a8017de4efd4eb02f1e3081ec Mon Sep 17 00:00:00 2001
741aa32
From: Dylan Baker <dylan@pnwbakers.com>
741aa32
Date: Mon, 25 Mar 2019 11:35:18 -0700
741aa32
Subject: [PATCH] compilers: n_debug=if-release and buildtype=plain should not
741aa32
 enable assertions
741aa32
741aa32
It's a bit odd that it doesn't, and has resulted in bugs in distro
741aa32
packaging.
741aa32
741aa32
Fixes #5141
741aa32
---
741aa32
 docs/markdown/snippets/debug-if-release-plain.md | 4 ++++
741aa32
 mesonbuild/compilers/compilers.py                | 2 +-
741aa32
 2 files changed, 5 insertions(+), 1 deletion(-)
741aa32
 create mode 100644 docs/markdown/snippets/debug-if-release-plain.md
741aa32
741aa32
diff --git a/docs/markdown/snippets/debug-if-release-plain.md b/docs/markdown/snippets/debug-if-release-plain.md
741aa32
new file mode 100644
741aa32
index 00000000..013e6c83
741aa32
--- /dev/null
741aa32
+++ b/docs/markdown/snippets/debug-if-release-plain.md
741aa32
@@ -0,0 +1,4 @@
741aa32
+## n_debug=if-release and buildtype=plain means no asserts
741aa32
+
741aa32
+Previously if this combination was used then assertions were enabled,
741aa32
+which is fairly surprising behavior.
741aa32
diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py
741aa32
index da029806..66195dc1 100644
741aa32
--- a/mesonbuild/compilers/compilers.py
741aa32
+++ b/mesonbuild/compilers/compilers.py
741aa32
@@ -510,7 +510,7 @@ def get_base_compile_args(options, compiler):
741aa32
     try:
741aa32
         if (options['b_ndebug'].value == 'true' or
741aa32
                 (options['b_ndebug'].value == 'if-release' and
741aa32
-                 options['buildtype'].value == 'release')):
741aa32
+                 options['buildtype'].value in {'release', 'plain'})):
741aa32
             args += ['-DNDEBUG']
741aa32
     except KeyError:
741aa32
         pass
741aa32
-- 
741aa32
2.21.0
741aa32