From 5873747a59943a0bfe885d054be9f042178c17c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Cerveau?= Date: Tue, 14 Mar 2023 11:49:57 +0100 Subject: [PATCH] tools: add bad/ges/omx tools to gst_tools In static mode, these tools must be built after the gstreamer-full library to use the symbol gst_init_static_plugins. Part-of: --- .../gst-editing-services/tools/meson.build | 11 +++++- subprojects/gst-omx/tools/meson.build | 35 ++++++++++++++----- subprojects/gst-plugins-bad/meson_options.txt | 1 + subprojects/gst-plugins-bad/tools/meson.build | 31 ++++++++++++---- .../gst-plugins-base/tools/meson.build | 4 +-- 5 files changed, 64 insertions(+), 18 deletions(-) diff --git a/subprojects/gst-editing-services/tools/meson.build b/subprojects/gst-editing-services/tools/meson.build index a7643356b8..e34e3071bb 100644 --- a/subprojects/gst-editing-services/tools/meson.build +++ b/subprojects/gst-editing-services/tools/meson.build @@ -18,7 +18,16 @@ gst_tools = {'ges-launch': } } -if not get_option('tools').disabled() +gst_tools = { + 'ges-launch': { + 'files': ges_launch_files, + 'deps': deps, + 'extra_c_args': [ges_tool_args] + ['-DG_LOG_DOMAIN="ges-launch-@0@"'.format(apiversion)] + }, +} + +if not get_option('tools').disabled() and not static_build + # FIXME: need ges_launch in the tests. ges_launch = executable('ges-launch-@0@'.format(apiversion), ges_launch_files, c_args : [ges_tool_args] + ['-DG_LOG_DOMAIN="ges-launch-@0@"'.format(apiversion)], diff --git a/subprojects/gst-omx/tools/meson.build b/subprojects/gst-omx/tools/meson.build index 419ab34b2a..f73996eadc 100644 --- a/subprojects/gst-omx/tools/meson.build +++ b/subprojects/gst-omx/tools/meson.build @@ -1,8 +1,27 @@ -executable('listcomponents', - 'listcomponents.c', - install: false, - include_directories : [configinc, omx_inc], - dependencies : [gmodule_dep], - link_with: [], - c_args : gst_omx_args + extra_c_args, -) +gst_tools = { + 'listcomponents': { + 'files': files('listcomponents.c'), + 'include_directories' : [configinc, omx_inc], + 'deps': [gmodule_dep], + 'extra_c_args': gst_omx_args + extra_c_args, + 'install': false, + }, +} + +if not get_option('tools').disabled() and not static_build + foreach tool, data: gst_tools + exe_name = '@0@-@1@'.format(tool, api_version) + executable(exe_name, + data.get('files'), + install: data.get('install', true), + install_tag: 'bin', + include_directories : data.get('include_directories', [configinc]), + dependencies : data.get('deps', []), + c_args: data.get('extra_c_args', []), + ) + + if data.has_key('man_page') + install_man(data.get('man_page')) + endif + endforeach +endif diff --git a/subprojects/gst-plugins-bad/meson_options.txt b/subprojects/gst-plugins-bad/meson_options.txt index 74d02791dc..4f96669721 100644 --- a/subprojects/gst-plugins-bad/meson_options.txt +++ b/subprojects/gst-plugins-bad/meson_options.txt @@ -224,6 +224,7 @@ option('gpl', type: 'feature', value: 'disabled', yield: true, # Common feature options option('examples', type : 'feature', value : 'auto', yield : true) +option('tools', type : 'feature', value : 'auto', yield : true) 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)') diff --git a/subprojects/gst-plugins-bad/tools/meson.build b/subprojects/gst-plugins-bad/tools/meson.build index 1b935cc9d4..b32d0d7bad 100644 --- a/subprojects/gst-plugins-bad/tools/meson.build +++ b/subprojects/gst-plugins-bad/tools/meson.build @@ -1,7 +1,24 @@ -executable('gst-transcoder-' + api_version, - 'gst-transcoder.c', 'utils.c', - install : true, - install_tag : 'bin', - dependencies : [gst_dep, gstpbutils_dep, gst_transcoder_dep], - c_args: ['-DG_LOG_DOMAIN="gst-transcoder-@0@"'.format(api_version)], -) +gst_tools = { + 'gst-transcoder': { + 'files': files('gst-transcoder.c', 'utils.c'), + 'deps': [gst_dep, gstpbutils_dep, gst_transcoder_dep], + }, +} + +if not get_option('tools').disabled() and not static_build + foreach tool, data: gst_tools + exe_name = '@0@-@1@'.format(tool, api_version) + executable(exe_name, + data.get('files'), + install: data.get('install', true), + install_tag: 'bin', + include_directories : data.get('include_directories', [configinc]), + dependencies : data.get('deps'), + c_args: data.get('extra_c_args', []) + ['-DG_LOG_DOMAIN="@0@"'.format(exe_name)], + ) + + if data.has_key('man_page') + install_man(data.get('man_page')) + endif + endforeach +endif \ No newline at end of file diff --git a/subprojects/gst-plugins-base/tools/meson.build b/subprojects/gst-plugins-base/tools/meson.build index 9dd781c43b..32d2a01a8b 100644 --- a/subprojects/gst-plugins-base/tools/meson.build +++ b/subprojects/gst-plugins-base/tools/meson.build @@ -49,9 +49,9 @@ if not get_option('tools').disabled() and not static_build exe_name = '@0@-@1@'.format(tool, api_version) executable(exe_name, data.get('files'), - install: true, + install: data.get('install', true), install_tag: 'bin', - include_directories : [configinc], + include_directories : data.get('include_directories', [configinc]), dependencies : data.get('deps'), c_args: data.get('extra_c_args', []) + gst_plugins_base_args + ['-DG_LOG_DOMAIN="@0@"'.format(exe_name)], )