summaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gmail.com>2020-04-14 12:54:40 +0000
committerEmmanuele Bassi <ebassi@gmail.com>2020-04-14 12:54:40 +0000
commit44b606c29d1e918d8e22d50cb8c3e92d3c4b816d (patch)
tree15e8e9845d3fdd895050bc7a663b47354f371e1c /meson.build
parent72f8c87507d6edbd1f918c0415eb8b5c4b80f130 (diff)
parenta2e37c9cb83ff2b95184527ed594f2b9a829404e (diff)
downloadpango-44b606c29d1e918d8e22d50cb8c3e92d3c4b816d.tar.gz
Merge branch 'fix-buildtype-usage' into 'master'
meson: Fix check for builtype arguments See merge request GNOME/pango!181
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build16
1 files changed, 9 insertions, 7 deletions
diff --git a/meson.build b/meson.build
index dc634c8a..a0d2ecc4 100644
--- a/meson.build
+++ b/meson.build
@@ -172,17 +172,19 @@ foreach h: checked_headers
endif
endforeach
-buildtype = get_option('buildtype')
-if buildtype.startswith('debug')
- pango_debug_cflags = [ '-DPANGO_ENABLE_DEBUG', ]
-elif buildtype == 'release'
- pango_debug_cflags = [ '-DG_DISABLE_CAST_CHECKS', ]
+# Use debug/optimization flags to determine whether to enable debug or disable
+# cast checks
+pango_debug_cflags = []
+if get_option('debug')
+ pango_debug_cflags = [ '-DPANGO_ENABLE_DEBUG' ]
+ message('Enabling various debug infrastructure')
+elif get_option('optimization') in ['2', '3', 's']
+ pango_debug_cflags = [ '-DG_DISABLE_CAST_CHECKS' ]
+ message('Disabling cast checks')
# TODO: We may want a configuration argument to add `G_DISABLE_CHECKS`
# and `G_DISABLE_ASSERT` from the build, for specific build environments.
# On the other hand, those who need these symbols can inject them in their
# build as well.
-else
- pango_debug_cflags = []
endif
# Dependencies