[pacman-dev,1/2] meson: use better check for debug builds

Message ID 20200505044110.1188135-1-eschwartz@archlinux.org
State Accepted, archived
Headers show
Series [pacman-dev,1/2] meson: use better check for debug builds | expand

Commit Message

Eli Schwartz May 5, 2020, 4:41 a.m. UTC
meson 0.48 added the 'debug' and 'optimization' builtin options, which
bidirectionally map to the buildtype, but in some cases where debug is
enabled, the builtype may be custom. Checking the 'debug' option lets us
detect every case currently detected, plus a few more, and does so in a
shorter and more concise manner.

Signed-off-by: Eli Schwartz <eschwartz@archlinux.org>
---
 meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Allan McRae May 5, 2020, 6:21 a.m. UTC | #1
On 5/5/20 2:41 pm, Eli Schwartz wrote:
> meson 0.48 added the 'debug' and 'optimization' builtin options, which
> bidirectionally map to the buildtype, but in some cases where debug is
> enabled, the builtype may be custom. Checking the 'debug' option lets us
> detect every case currently detected, plus a few more, and does so in a
> shorter and more concise manner.
> 
> Signed-off-by: Eli Schwartz <eschwartz@archlinux.org>
> ---

OK.

Patch

diff --git a/meson.build b/meson.build
index 572526b2..680cf62b 100644
--- a/meson.build
+++ b/meson.build
@@ -177,7 +177,7 @@  elif conf.has('HAVE_STRUCT_STATFS_F_FLAGS')
   conf.set('FSSTATSTYPE', 'struct statfs')
 endif
 
-if get_option('buildtype').startswith('debug')
+if get_option('debug')
   extra_cflags = [
     '-Wcast-align',
     '-Wclobbered',