From 84b3a0950debc467ce25aebdddd0d827e658252e Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Wed, 8 Apr 2020 10:40:42 -0400 Subject: [PATCH] build: Add missing common options that are yielding in subprojects - Align `glib_debug`, `glib_assert` and `glib_checks` options with GLib, otherwise glib subproject won't inherit their value. Previous names and values are preserved using Meson's deprecation mechanism. - Add `extra-checks` and `benchmarks` options in the main project so it can be inherited in GStreamer subprojects. Part-of: --- meson_options.txt | 47 ++++++++++++------- subprojects/gst-plugins-bad/meson.build | 12 ++--- subprojects/gst-plugins-bad/meson_options.txt | 24 +++++++--- subprojects/gst-plugins-base/meson.build | 12 ++--- .../gst-plugins-base/meson_options.txt | 24 +++++++--- subprojects/gst-plugins-good/meson.build | 12 ++--- .../gst-plugins-good/meson_options.txt | 24 +++++++--- subprojects/gst-plugins-ugly/meson.build | 12 ++--- .../gst-plugins-ugly/meson_options.txt | 24 +++++++--- subprojects/gst-rtsp-server/meson.build | 12 ++--- subprojects/gst-rtsp-server/meson_options.txt | 24 +++++++--- subprojects/gstreamer/gst/meson.build | 6 +-- subprojects/gstreamer/meson.build | 16 ++++--- subprojects/gstreamer/meson_options.txt | 24 +++++++--- 14 files changed, 181 insertions(+), 92 deletions(-) diff --git a/meson_options.txt b/meson_options.txt index 91b1449f18..f9a345d813 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -46,31 +46,44 @@ option('virtme_kernel_image', type: 'string', value: '', description: 'Path to a # License-related feature options option('gpl', type: 'feature', value: 'disabled', description: 'Allow build of plugins that have (A)GPL-licensed dependencies') +option('gstreamer-full-license', type : 'string', value : 'unknown', + description : 'gstreamer-full license (default unknown)') -# Common options, automatically inherited by subprojects -option('tests', type : 'feature', value : 'auto', description : 'Build tests') +# Common options specific to GStreamer, automatically inherited by subprojects. +option('package-origin', type : 'string', value : 'Unknown package origin', yield : true, + description : 'package origin URL to use in plugins') +option('package-name', type : 'string', yield : true, + description : 'package name to use in plugins') +option('extra-checks', type : 'feature', value : 'enabled', description : 'Enable extra runtime checks') +option('benchmarks', type : 'feature', value : 'auto') option('tools', type : 'feature', value : 'auto', yield : true, description : 'Build command line tools') -option('examples', type : 'feature', value : 'auto', description : 'Build examples') -option('introspection', type : 'feature', value : 'auto', description : 'Generate introspection data') -option('nls', type : 'feature', value : 'auto', description : 'Native language support (translations)') option('orc', type : 'feature', value : 'auto', description : 'Optimized Inner Loop Runtime Compiler (SIMD)') -option('doc', type : 'feature', value : 'disabled', description : 'Generate API documentation with hotdoc') -option('gtk_doc', type : 'feature', value : 'disabled', description : 'Generate API documentation with gtk-doc') option('qt5', type : 'feature', value : 'auto', description : 'Qt5 toolkit support') option('qt6', type : 'feature', value : 'auto', description : 'Qt6 toolkit support') option('webrtc', type : 'feature', value : 'auto', description : 'WebRTC support') -option('package-origin', type : 'string', value : 'Unknown package origin', yield : true, - description : 'package origin URL to use in plugins') +# Common options shared by other projects, automatically inherited by subprojects. +option('glib_debug', type : 'feature', value : 'auto', yield : true, description : 'Enable GLib debug infrastructure (see docs/macros.txt)') +option('glib_assert', type : 'boolean', value : true, yield : true, description : 'Enable GLib assertion (see docs/macros.txt)', + deprecated: {'enabled' : 'true', 'disabled' : 'false', 'auto' : 'false'}, +) +option('glib_checks', type : 'boolean', value : true, yield : true, description : 'Enable GLib checks such as API guards (see docs/macros.txt)', + deprecated: {'enabled' : 'true', 'disabled' : 'false', 'auto' : 'false'}, +) +option('tests', type : 'feature', value : 'auto', description : 'Build tests') +option('examples', type : 'feature', value : 'auto', description : 'Build examples') +option('introspection', type : 'feature', value : 'auto', description : 'Generate introspection data') +option('nls', type : 'feature', value : 'auto', description : 'Native language support (translations)') +option('doc', type : 'feature', value : 'disabled', description : 'Generate API documentation with hotdoc') +option('gtk_doc', type : 'feature', value : 'disabled', description : 'Generate API documentation with gtk-doc') +# Deprecated, kept for backward compat 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)') + description: 'Enable run-time GObject cast checks (auto = enabled for development, disabled for stable releases)', + deprecated: 'glib_debug') option('glib-asserts', type : 'feature', value : 'enabled', yield : true, - description: 'Enable GLib assertion (auto = enabled for development, disabled for stable releases)') + description: 'Enable GLib assertion (auto = enabled for development, disabled for stable releases)', + deprecated: 'glib_assert') 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)') - -option('package-name', type : 'string', yield : true, - description : 'package name to use in plugins') -option('gstreamer-full-license', type : 'string', value : 'unknown', - description : 'gstreamer-full license (default unknown)') + description: 'Enable GLib checks such as API guards (auto = enabled for development, disabled for stable releases)', + deprecated: 'glib_checks') diff --git a/subprojects/gst-plugins-bad/meson.build b/subprojects/gst-plugins-bad/meson.build index 3992836333..7c802e76f8 100644 --- a/subprojects/gst-plugins-bad/meson.build +++ b/subprojects/gst-plugins-bad/meson.build @@ -133,20 +133,20 @@ if gst_version_is_dev 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) +# Same logic as in GLib. +glib_debug = get_option('glib_debug') +if glib_debug.disabled() or ( + glib_debug.auto() and (not get_option('debug') or get_option('optimization') not in [ '0', 'g' ])) 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) +if not get_option('glib_assert') 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) +if not get_option('glib_checks') message('Disabling GLib checks') add_project_arguments('-DG_DISABLE_CHECKS', language: 'c') endif diff --git a/subprojects/gst-plugins-bad/meson_options.txt b/subprojects/gst-plugins-bad/meson_options.txt index fb3db29119..58922f0adb 100644 --- a/subprojects/gst-plugins-bad/meson_options.txt +++ b/subprojects/gst-plugins-bad/meson_options.txt @@ -265,12 +265,6 @@ option('tests', type : 'feature', value : 'auto', yield : true) option('introspection', type : 'feature', value : 'auto', yield : true, description : 'Generate gobject-introspection bindings') option('nls', type : 'feature', value : 'auto', yield: true, description : 'Enable native language support (translations)') option('orc', type : 'feature', value : 'auto', yield : true) -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)') option('extra-checks', type : 'feature', value : 'enabled', yield : true, description : 'Enable extra runtime checks') # Common options @@ -280,3 +274,21 @@ option('package-origin', type : 'string', value : 'Unknown package origin', yiel description : 'package origin URL to use in plugins') option('doc', type : 'feature', value : 'auto', yield: true, description: 'Enable documentation.') +option('glib_debug', type : 'feature', value : 'auto', yield : true, description : 'Enable GLib debug infrastructure (see docs/macros.txt)') +option('glib_assert', type : 'boolean', value : true, yield : true, description : 'Enable GLib assertion (see docs/macros.txt)', + deprecated: {'enabled' : 'true', 'disabled' : 'false', 'auto' : 'false'}, +) +option('glib_checks', type : 'boolean', value : true, yield : true, description : 'Enable GLib checks such as API guards (see docs/macros.txt)', + deprecated: {'enabled' : 'true', 'disabled' : 'false', 'auto' : 'false'}, +) + +# Deprecated, kept for backward compat +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)', + deprecated: 'glib_debug') +option('glib-asserts', type : 'feature', value : 'enabled', yield : true, + description: 'Enable GLib assertion (auto = enabled for development, disabled for stable releases)', + deprecated: 'glib_assert') +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)', + deprecated: 'glib_checks') diff --git a/subprojects/gst-plugins-base/meson.build b/subprojects/gst-plugins-base/meson.build index 84a450b424..311604f737 100644 --- a/subprojects/gst-plugins-base/meson.build +++ b/subprojects/gst-plugins-base/meson.build @@ -121,20 +121,20 @@ if gst_version_is_dev 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) +# Same logic as in GLib. +glib_debug = get_option('glib_debug') +if glib_debug.disabled() or ( + glib_debug.auto() and (not get_option('debug') or get_option('optimization') not in [ '0', 'g' ])) 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) +if not get_option('glib_assert') 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) +if not get_option('glib_checks') message('Disabling GLib checks') add_project_arguments('-DG_DISABLE_CHECKS', language: 'c') endif diff --git a/subprojects/gst-plugins-base/meson_options.txt b/subprojects/gst-plugins-base/meson_options.txt index 0f307b21dc..17b5743951 100644 --- a/subprojects/gst-plugins-base/meson_options.txt +++ b/subprojects/gst-plugins-base/meson_options.txt @@ -76,12 +76,6 @@ option('tools', type : 'feature', value : 'auto', yield : true) option('introspection', type : 'feature', value : 'auto', yield : true, description : 'Generate gobject-introspection bindings') option('nls', type : 'feature', value : 'auto', yield: true, description : 'Enable native language support (translations)') option('orc', type : 'feature', value : 'auto', yield : true) -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)') option('qt5', type : 'feature', value : 'auto', yield : true, description : 'Qt5 QML examples') # Common options @@ -91,3 +85,21 @@ option('package-origin', type : 'string', value : 'Unknown package origin', yiel description : 'package origin URL to use in plugins') option('doc', type : 'feature', value : 'auto', yield: true, description: 'Enable documentation.') +option('glib_debug', type : 'feature', value : 'auto', yield : true, description : 'Enable GLib debug infrastructure (see docs/macros.txt)') +option('glib_assert', type : 'boolean', value : true, yield : true, description : 'Enable GLib assertion (see docs/macros.txt)', + deprecated: {'enabled' : 'true', 'disabled' : 'false', 'auto' : 'false'}, +) +option('glib_checks', type : 'boolean', value : true, yield : true, description : 'Enable GLib checks such as API guards (see docs/macros.txt)', + deprecated: {'enabled' : 'true', 'disabled' : 'false', 'auto' : 'false'}, +) + +# Deprecated, kept for backward compat +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)', + deprecated: 'glib_debug') +option('glib-asserts', type : 'feature', value : 'enabled', yield : true, + description: 'Enable GLib assertion (auto = enabled for development, disabled for stable releases)', + deprecated: 'glib_assert') +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)', + deprecated: 'glib_checks') diff --git a/subprojects/gst-plugins-good/meson.build b/subprojects/gst-plugins-good/meson.build index 0824f3feb6..c98fcdd5ac 100644 --- a/subprojects/gst-plugins-good/meson.build +++ b/subprojects/gst-plugins-good/meson.build @@ -114,20 +114,20 @@ if gst_version_is_dev 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) +# Same logic as in GLib. +glib_debug = get_option('glib_debug') +if glib_debug.disabled() or ( + glib_debug.auto() and (not get_option('debug') or get_option('optimization') not in [ '0', 'g' ])) 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) +if not get_option('glib_assert') 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) +if not get_option('glib_checks') message('Disabling GLib checks') add_project_arguments('-DG_DISABLE_CHECKS', language: 'c') endif diff --git a/subprojects/gst-plugins-good/meson_options.txt b/subprojects/gst-plugins-good/meson_options.txt index f57883d5da..c110e30cfa 100644 --- a/subprojects/gst-plugins-good/meson_options.txt +++ b/subprojects/gst-plugins-good/meson_options.txt @@ -119,12 +119,6 @@ option('examples', type : 'feature', value : 'auto', yield : true) option('tests', type : 'feature', value : 'auto', yield : true) option('nls', type : 'feature', value : 'auto', yield: true, description : 'Enable native language support (translations)') option('orc', type : 'feature', value : 'auto', yield : true) -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)') option('asm', type : 'feature', value : 'auto', yield : true) # Common options @@ -134,3 +128,21 @@ option('package-origin', type : 'string', value : 'Unknown package origin', yiel description : 'package origin URL to use in plugins') option('doc', type : 'feature', value : 'auto', yield: true, description: 'Enable documentation.') +option('glib_debug', type : 'feature', value : 'auto', yield : true, description : 'Enable GLib debug infrastructure (see docs/macros.txt)') +option('glib_assert', type : 'boolean', value : true, yield : true, description : 'Enable GLib assertion (see docs/macros.txt)', + deprecated: {'enabled' : 'true', 'disabled' : 'false', 'auto' : 'false'}, +) +option('glib_checks', type : 'boolean', value : true, yield : true, description : 'Enable GLib checks such as API guards (see docs/macros.txt)', + deprecated: {'enabled' : 'true', 'disabled' : 'false', 'auto' : 'false'}, +) + +# Deprecated, kept for backward compat +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)', + deprecated: 'glib_debug') +option('glib-asserts', type : 'feature', value : 'enabled', yield : true, + description: 'Enable GLib assertion (auto = enabled for development, disabled for stable releases)', + deprecated: 'glib_assert') +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)', + deprecated: 'glib_checks') diff --git a/subprojects/gst-plugins-ugly/meson.build b/subprojects/gst-plugins-ugly/meson.build index 9ed51b0d1b..2aa2b6a6ae 100644 --- a/subprojects/gst-plugins-ugly/meson.build +++ b/subprojects/gst-plugins-ugly/meson.build @@ -289,20 +289,20 @@ if gst_version_is_dev 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) +# Same logic as in GLib. +glib_debug = get_option('glib_debug') +if glib_debug.disabled() or ( + glib_debug.auto() and (not get_option('debug') or get_option('optimization') not in [ '0', 'g' ])) 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) +if not get_option('glib_assert') 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) +if not get_option('glib_checks') message('Disabling GLib checks') add_project_arguments('-DG_DISABLE_CHECKS', language: 'c') endif diff --git a/subprojects/gst-plugins-ugly/meson_options.txt b/subprojects/gst-plugins-ugly/meson_options.txt index 231d351ebf..f9e7e91361 100644 --- a/subprojects/gst-plugins-ugly/meson_options.txt +++ b/subprojects/gst-plugins-ugly/meson_options.txt @@ -24,12 +24,6 @@ option('nls', type : 'feature', value : 'auto', yield: true, description : 'Enable native language support (translations)') option('orc', type : 'feature', value : 'auto', yield : true) option('tests', type : 'feature', value : 'auto', yield : true) -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, @@ -38,3 +32,21 @@ option('package-origin', type : 'string', value : 'Unknown package origin', yiel description : 'package origin URL to use in plugins') option('doc', type : 'feature', value : 'auto', yield: true, description: 'Enable documentation.') +option('glib_debug', type : 'feature', value : 'auto', yield : true, description : 'Enable GLib debug infrastructure (see docs/macros.txt)') +option('glib_assert', type : 'boolean', value : true, yield : true, description : 'Enable GLib assertion (see docs/macros.txt)', + deprecated: {'enabled' : 'true', 'disabled' : 'false', 'auto' : 'false'}, +) +option('glib_checks', type : 'boolean', value : true, yield : true, description : 'Enable GLib checks such as API guards (see docs/macros.txt)', + deprecated: {'enabled' : 'true', 'disabled' : 'false', 'auto' : 'false'}, +) + +# Deprecated, kept for backward compat +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)', + deprecated: 'glib_debug') +option('glib-asserts', type : 'feature', value : 'enabled', yield : true, + description: 'Enable GLib assertion (auto = enabled for development, disabled for stable releases)', + deprecated: 'glib_assert') +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)', + deprecated: 'glib_checks') diff --git a/subprojects/gst-rtsp-server/meson.build b/subprojects/gst-rtsp-server/meson.build index 31fd9d13c8..7d87678e1a 100644 --- a/subprojects/gst-rtsp-server/meson.build +++ b/subprojects/gst-rtsp-server/meson.build @@ -64,20 +64,20 @@ if gst_version_is_dev 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) +# Same logic as in GLib. +glib_debug = get_option('glib_debug') +if glib_debug.disabled() or ( + glib_debug.auto() and (not get_option('debug') or get_option('optimization') not in [ '0', 'g' ])) 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) +if not get_option('glib_assert') 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) +if not get_option('glib_checks') message('Disabling GLib checks') add_project_arguments('-DG_DISABLE_CHECKS', language: 'c') endif diff --git a/subprojects/gst-rtsp-server/meson_options.txt b/subprojects/gst-rtsp-server/meson_options.txt index 4bd238dc32..36065f186c 100644 --- a/subprojects/gst-rtsp-server/meson_options.txt +++ b/subprojects/gst-rtsp-server/meson_options.txt @@ -8,12 +8,6 @@ option('tests', type : 'feature', value : 'auto', yield : true, description : 'Build and enable unit tests') option('introspection', type : 'feature', value : 'auto', yield : true, 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 option('package-name', type : 'string', yield : true, @@ -23,3 +17,21 @@ option('package-origin', type : 'string', description : 'package origin URL to use in plugins') option('doc', type : 'feature', value : 'auto', yield: true, description: 'Enable documentation.') +option('glib_debug', type : 'feature', value : 'auto', yield : true, description : 'Enable GLib debug infrastructure (see docs/macros.txt)') +option('glib_assert', type : 'boolean', value : true, yield : true, description : 'Enable GLib assertion (see docs/macros.txt)', + deprecated: {'enabled' : 'true', 'disabled' : 'false', 'auto' : 'false'}, +) +option('glib_checks', type : 'boolean', value : true, yield : true, description : 'Enable GLib checks such as API guards (see docs/macros.txt)', + deprecated: {'enabled' : 'true', 'disabled' : 'false', 'auto' : 'false'}, +) + +# Deprecated, kept for backward compat +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)', + deprecated: 'glib_debug') +option('glib-asserts', type : 'feature', value : 'enabled', yield : true, + description: 'Enable GLib assertion (auto = enabled for development, disabled for stable releases)', + deprecated: 'glib_assert') +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)', + deprecated: 'glib_checks') diff --git a/subprojects/gstreamer/gst/meson.build b/subprojects/gstreamer/gst/meson.build index 825b43aa6c..bc77e50a20 100644 --- a/subprojects/gstreamer/gst/meson.build +++ b/subprojects/gstreamer/gst/meson.build @@ -203,9 +203,9 @@ else gst_cdata.set('GST_DISABLE_PARSE_DEFINE', '#define GST_DISABLE_PARSE 1') endif -gst_cdata.set10('GST_DISABLE_CAST_CHECKS_DEFINE', cast_checks.disabled()) -gst_cdata.set10('GST_DISABLE_GLIB_ASSERTS_DEFINE', glib_asserts.disabled()) -gst_cdata.set10('GST_DISABLE_GLIB_CHECKS_DEFINE', glib_checks.disabled()) +gst_cdata.set10('GST_DISABLE_CAST_CHECKS_DEFINE', disable_cast_checks) +gst_cdata.set10('GST_DISABLE_GLIB_ASSERTS_DEFINE', disable_glib_asserts) +gst_cdata.set10('GST_DISABLE_GLIB_CHECKS_DEFINE', disable_glib_checks) # FIXME: add --disable-plugin option? gst_cdata.set('GST_DISABLE_PLUGIN_DEFINE', '#undef GST_DISABLE_PLUGIN') diff --git a/subprojects/gstreamer/meson.build b/subprojects/gstreamer/meson.build index 2a99ce6e40..1ef2ee1f18 100644 --- a/subprojects/gstreamer/meson.build +++ b/subprojects/gstreamer/meson.build @@ -108,20 +108,24 @@ if gst_version_is_dev 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) +# Same logic as in GLib. +glib_debug = get_option('glib_debug') +disable_cast_checks = glib_debug.disabled() or ( + glib_debug.auto() and (not get_option('debug') or get_option('optimization') not in [ '0', 'g' ])) +if disable_cast_checks message('Disabling GLib cast checks') add_project_arguments('-DG_DISABLE_CAST_CHECKS', language: 'c') + disable_cast_checks = true endif -glib_asserts = get_option('glib-asserts') -if glib_asserts.disabled() or (glib_asserts.auto() and not gst_version_is_dev) +disable_glib_asserts = not get_option('glib_assert') +if disable_glib_asserts 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) +disable_glib_checks = not get_option('glib_checks') +if disable_glib_checks message('Disabling GLib checks') add_project_arguments('-DG_DISABLE_CHECKS', language: 'c') endif diff --git a/subprojects/gstreamer/meson_options.txt b/subprojects/gstreamer/meson_options.txt index 340fb5801d..39255cf57e 100644 --- a/subprojects/gstreamer/meson_options.txt +++ b/subprojects/gstreamer/meson_options.txt @@ -33,12 +33,6 @@ option('benchmarks', type : 'feature', value : 'auto', yield : true) option('tools', type : 'feature', value : 'auto', yield : true) option('introspection', type : 'feature', value : 'auto', yield : true, description : 'Generate gobject-introspection bindings') option('nls', type : 'feature', value : 'auto', yield: true, description : 'Enable native language support (translations)') -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)') option('extra-checks', type : 'feature', value : 'enabled', yield : true, description : 'Enable extra runtime checks') # Common options @@ -48,3 +42,21 @@ option('package-origin', type : 'string', value : 'Unknown package origin', yiel description : 'package origin URL to use in plugins') option('doc', type : 'feature', value : 'auto', yield: true, description: 'Enable documentation.') +option('glib_debug', type : 'feature', value : 'auto', yield : true, description : 'Enable GLib debug infrastructure (see docs/macros.txt)') +option('glib_assert', type : 'boolean', value : true, yield : true, description : 'Enable GLib assertion (see docs/macros.txt)', + deprecated: {'enabled' : 'true', 'disabled' : 'false', 'auto' : 'false'}, +) +option('glib_checks', type : 'boolean', value : true, yield : true, description : 'Enable GLib checks such as API guards (see docs/macros.txt)', + deprecated: {'enabled' : 'true', 'disabled' : 'false', 'auto' : 'false'}, +) + +# Deprecated, kept for backward compat +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)', + deprecated: 'glib_debug') +option('glib-asserts', type : 'feature', value : 'enabled', yield : true, + description: 'Enable GLib assertion (auto = enabled for development, disabled for stable releases)', + deprecated: 'glib_assert') +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)', + deprecated: 'glib_checks')