mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 03:16:17 +01:00
Meson: Define G_ENABLE_DEBUG and friends
https://bugzilla.gnome.org/show_bug.cgi?id=794790
This commit is contained in:
parent
b0ae762a33
commit
cc7e0f6cc2
10
meson.build
10
meson.build
@ -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 = [
|
||||
|
Loading…
Reference in New Issue
Block a user