Skip to content

Commit

Permalink
meson: add glib-checks option to disable API guards and such
Browse files Browse the repository at this point in the history
We want this enabled by default, also in releases, but people
may want to disable this for performance-critical workloads or
on embedded devices.
  • Loading branch information
tp-m committed Sep 19, 2018
1 parent 1978287 commit c0c112a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions meson.build
Expand Up @@ -86,6 +86,12 @@ if glib_asserts.disabled() or (glib_asserts.auto() and not gst_version_is_dev)
add_project_arguments('-DG_DISABLE_ASSERT', language: 'c')
endif

glib_checks = get_option('glib-checks')
if glib_checks.disabled() or (glib_checks.auto() and not gst_version_is_dev)
message('Disabling GLib checks')
add_project_arguments('-DG_DISABLE_CHECKS', language: 'c')
endif

core_conf = configuration_data()
check_headers = [
['HAVE_DLFCN_H', 'dlfcn.h'],
Expand Down
2 changes: 2 additions & 0 deletions meson_options.txt
Expand Up @@ -75,6 +75,8 @@ option('gobject-cast-checks', type : 'feature', value : 'auto', yield : true,
description: 'Enable run-time GObject cast checks (auto = enabled for development, disabled for stable releases)')
option('glib-asserts', type : 'feature', value : 'enabled', yield : true,
description: 'Enable GLib assertion (auto = enabled for development, disabled for stable releases)')
option('glib-checks', type : 'feature', value : 'enabled', yield : true,
description: 'Enable GLib checks such as API guards (auto = enabled for development, disabled for stable releases)')

# Common options
option('package-name', type : 'string', yield : true,
Expand Down

0 comments on commit c0c112a

Please sign in to comment.