meson: add gobject-cast-checks, glib-asserts, glib-checks options

This commit is contained in:
Tim-Philipp Müller 2018-09-19 12:21:30 +01:00
parent ffebe3dd84
commit a44a729acb
2 changed files with 31 additions and 0 deletions

View file

@ -13,6 +13,7 @@ gst_version_micro = version_arr[2].to_int()
else else
gst_version_nano = 0 gst_version_nano = 0
endif endif
gst_version_is_dev = gst_version_minor % 2 == 1 and gst_version_micro < 90
glib_req = '>= 2.40.0' glib_req = '>= 2.40.0'
gst_req = '>= @0@.@1@.0'.format(gst_version_major, gst_version_minor) gst_req = '>= @0@.@1@.0'.format(gst_version_major, gst_version_minor)
@ -43,6 +44,30 @@ if cc.has_argument('-fno-strict-aliasing')
add_project_arguments('-fno-strict-aliasing', language: 'c') add_project_arguments('-fno-strict-aliasing', language: 'c')
endif endif
# Define G_DISABLE_DEPRECATED for development versions
if gst_version_is_dev
message('Disabling deprecated GLib API')
add_project_arguments('-DG_DISABLE_DEPRECATED', language: 'c')
endif
cast_checks = get_option('gobject-cast-checks')
if cast_checks.disabled() or (cast_checks.auto() and not gst_version_is_dev)
message('Disabling GLib cast checks')
add_project_arguments('-DG_DISABLE_CAST_CHECKS', language: 'c')
endif
glib_asserts = get_option('glib-asserts')
if glib_asserts.disabled() or (glib_asserts.auto() and not gst_version_is_dev)
message('Disabling GLib asserts')
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
cdata = configuration_data() cdata = configuration_data()
cdata.set_quoted('GETTEXT_PACKAGE', 'gst-rtsp-server-1.0') cdata.set_quoted('GETTEXT_PACKAGE', 'gst-rtsp-server-1.0')
cdata.set_quoted('PACKAGE', 'gst-rtsp-server') cdata.set_quoted('PACKAGE', 'gst-rtsp-server')

View file

@ -8,6 +8,12 @@ option('tests', type : 'feature', value : 'auto', yield : true,
description : 'Build and enable unit tests') description : 'Build and enable unit tests')
option('introspection', type : 'feature', value : 'auto', yield : true, option('introspection', type : 'feature', value : 'auto', yield : true,
description : 'Generate gobject-introspection bindings') description : 'Generate gobject-introspection bindings')
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 # Common options
option('package-name', type : 'string', yield : true, option('package-name', type : 'string', yield : true,