From c0c112a45c52f457686ed215dd3cf8db635bab5d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim-Philipp=20M=C3=BCller?= Date: Wed, 19 Sep 2018 11:42:14 +0100 Subject: [PATCH] meson: add glib-checks option to disable API guards and such We want this enabled by default, also in releases, but people may want to disable this for performance-critical workloads or on embedded devices. --- meson.build | 6 ++++++ meson_options.txt | 2 ++ 2 files changed, 8 insertions(+) diff --git a/meson.build b/meson.build index b5fe51e..37013de 100644 --- a/meson.build +++ b/meson.build @@ -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'], diff --git a/meson_options.txt b/meson_options.txt index a6461ef..8056306 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -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, -- 2.7.4