Meson: Define G_ENABLE_DEBUG and friends

https://bugzilla.gnome.org/show_bug.cgi?id=794790
This commit is contained in:
Xavier Claessens 2018-03-28 21:37:38 -04:00
parent b0ae762a33
commit cc7e0f6cc2

View File

@ -2,6 +2,7 @@ project('glib', 'c', 'cpp',
version : '2.57.0',
meson_version : '>= 0.45.0',
default_options : [
'buildtype=debugoptimized',
'warning_level=1',
'c_std=gnu89'
]
@ -190,6 +191,15 @@ glibconfig_conf.set('glib_os', glib_os)
# for dependencies that don't normally come with pkg-config files for Visual Studio builds
buildtype = get_option('buildtype')
glib_debug_cflags = []
if buildtype.startswith('debug')
glib_debug_cflags += ['-DG_ENABLE_DEBUG']
elif buildtype == 'release'
glib_debug_cflags += ['-DG_DISABLE_CAST_CHECKS']
endif
add_project_arguments(glib_debug_cflags, language: 'c')
# check for header files
headers = [