build: Add glib_debug option

To allow disabling debug infrastructure in builds with debug symbols.
This commit is contained in:
Ole André Vadla Ravnås
2021-01-20 00:37:22 +01:00
parent 2e3e35157e
commit 670b84ca30
3 changed files with 12 additions and 1 deletions

View File

@@ -235,7 +235,8 @@ endif
# Use debug/optimization flags to determine whether to enable debug or disable
# cast checks
glib_debug_cflags = []
if get_option('debug')
glib_debug = get_option('glib_debug')
if glib_debug.enabled() or (glib_debug.auto() and get_option('debug'))
glib_debug_cflags += ['-DG_ENABLE_DEBUG']
message('Enabling various debug infrastructure')
elif get_option('optimization') in ['2', '3', 's']