mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 03:16:17 +01:00
meson: Fix check for builtype arguments
`get_option('buildtype')` will return `'custom'` for most combinations of `-Doptimization` and `-Ddebug`, but those two will always be set correctly if only `-Dbuildtype` is set. So we should look at those options directly. For the two-way mapping between `buildtype` and `optimization` + `debug`, see this table: https://mesonbuild.com/Builtin-options.html#build-type-options
This commit is contained in:
parent
b4d6849c83
commit
e7cfe62e73
@ -214,11 +214,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')
|
||||
|
||||
# Use debug/optimization flags to determine whether to enable debug or disable
|
||||
# cast checks
|
||||
glib_debug_cflags = []
|
||||
if buildtype.startswith('debug')
|
||||
if get_option('debug')
|
||||
glib_debug_cflags += ['-DG_ENABLE_DEBUG']
|
||||
elif buildtype == 'release'
|
||||
message('Enabling various debug infrastructure')
|
||||
elif get_option('optimization') in ['2', '3', 's']
|
||||
glib_debug_cflags += ['-DG_DISABLE_CAST_CHECKS']
|
||||
message('Disabling cast checks')
|
||||
endif
|
||||
|
||||
add_project_arguments(glib_debug_cflags, language: 'c')
|
||||
|
Loading…
Reference in New Issue
Block a user