meson: Rename plugins list and make them "dependency" objects

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2970>
This commit is contained in:
Thibault Saunier 2022-08-31 18:44:14 -04:00 committed by GStreamer Marge Bot
parent e1d3612321
commit b5e90fe579
11 changed files with 104 additions and 12 deletions

View file

@ -173,8 +173,17 @@ foreach sp : subprojects
endif
if subproj.found()
plugins = subproj.get_variable('plugins', [])
plugins = subproj.get_variable('gst_plugins', [])
all_plugins += plugins
if subproj.get_variable('gst_plugins', []).length() != subproj.get_variable('plugins', plugins).length()
warning(f'DEPRECATED use of the `plugins` variable in @project_name@.')
warning('The variable should now be called `gst_plugins` and use:')
warning('`declare_dependency( link_with: <plugin_target>, variable: {\'full_path\': <plugin_target>.full_path()})` instead')
foreach plugin: subproj.get_variable('plugins', [])
all_plugins += [declare_dependency(link_with: plugin, variables: {'full_path': plugin.full_path()})]
endforeach
endif
all_libraries += subproj.get_variable('libraries', [])
if not get_option('tools').disabled()
all_tools += subproj.get_variable('gst_tools', {})
@ -185,9 +194,7 @@ foreach sp : subprojects
subprojects_names += [project_name]
if not meson.is_cross_build() and build_infos.get('build-hotdoc', false)
if plugins.length() > 0
plugins_doc_caches += [subproj.get_variable('plugins_doc_dep', [])]
endif
plugins_doc_caches += [subproj.get_variable('plugins_doc_dep', [])]
if documented_projects != ''
documented_projects += ','
endif
@ -252,10 +259,14 @@ endif
all_plugins_paths = []
all_plugins_dirs = []
plugins_names = []
foreach plugin: all_plugins
all_plugins_paths += plugin.full_path()
all_plugins_dirs += fs.parent(plugin.full_path())
plugin_path = plugin.get_variable('full_path')
all_plugins_paths += plugin_path
all_plugins_dirs += fs.parent(plugin_path)
plugins_names += plugin_path
endforeach
# Work around meson bug: https://github.com/mesonbuild/meson/pull/6770
pathsep = host_machine.system() == 'windows' ? ';' : ':'
all_plugins_paths = pathsep.join(all_plugins_paths)
@ -295,10 +306,6 @@ if building_full
gst_c_args = ['-DHAVE_CONFIG_H']
# Generate a .c file which declare and register all built plugins
plugins_names = []
foreach plugin: all_plugins
plugins_names += plugin.full_path()
endforeach
all_plugin_names = ';'.join(plugins_names)
static_plugins = get_option('gst-full-plugins')
@ -380,10 +387,9 @@ if building_full
# Build both shared and static library
gstfull = both_libraries('gstreamer-full-1.0',
init_static_plugins_c,
link_with : all_plugins,
link_args: gstfull_link_args,
link_whole : exposed_libs,
dependencies : incdir_deps + glib_deps,
dependencies : [incdir_deps, glib_deps, all_plugins],
link_depends : link_deps,
install : true,
)

View file

@ -167,3 +167,20 @@ if not get_option('debug_viewer').disabled()
subdir('debug-viewer')
endif
subdir('docs')
plugin_names = []
gst_plugins = []
foreach plugin: plugins
dep = declare_dependency(link_with: plugin, variables: {'full_path': plugin.full_path()})
meson.override_dependency(plugin.name(), dep)
gst_plugins += [dep]
if plugin.name().startswith('gst')
plugin_names += [plugin.name().substring(3)]
else
plugin_names += [plugin.name()]
endif
endforeach
summary({
'Plugins': plugin_names,
}, list_sep: ', ')

View file

@ -337,7 +337,11 @@ endif
configure_file(output: 'config.h', configuration: cdata)
plugin_names = []
gst_plugins = []
foreach plugin: plugins
dep = declare_dependency(link_with: plugin, variables: {'full_path': plugin.full_path()})
meson.override_dependency(plugin.name(), dep)
gst_plugins += [dep]
if plugin.name().startswith('gst')
plugin_names += [plugin.name().substring(3)]
else

View file

@ -229,3 +229,11 @@ if gst_version_nano == 0
endif
configure_file(output: 'config.h', configuration: cdata)
gst_plugins = []
foreach plugin: plugins
pkgconfig.generate(plugin, install_dir: plugins_pkgconfig_install_dir)
dep = declare_dependency(link_with: plugin, variables: {'full_path': plugin.full_path()})
meson.override_dependency(plugin.name(), dep)
gst_plugins += [dep]
endforeach

View file

@ -595,7 +595,11 @@ configure_file(output : 'config.h', configuration : cdata)
subdir('docs')
plugin_names = []
gst_plugins = []
foreach plugin: plugins
dep = declare_dependency(link_with: plugin, variables: {'full_path': plugin.full_path()})
meson.override_dependency(plugin.name(), dep)
gst_plugins += [dep]
if plugin.name().startswith('gst')
plugin_names += [plugin.name().substring(3)]
else

View file

@ -545,7 +545,11 @@ endif
configure_file(output : 'config.h', configuration : core_conf)
plugin_names = []
gst_plugins = []
foreach plugin: plugins
dep = declare_dependency(link_with: plugin, variables: {'full_path': plugin.full_path()})
meson.override_dependency(plugin.name(), dep)
gst_plugins += [dep]
if plugin.name().startswith('gst')
plugin_names += [plugin.name().substring(3)]
else

View file

@ -510,7 +510,11 @@ endif
configure_file(output : 'config.h', configuration : cdata)
plugin_names = []
gst_plugins = []
foreach plugin: plugins
dep = declare_dependency(link_with: plugin, variables: {'full_path': plugin.full_path()})
meson.override_dependency(plugin.name(), dep)
gst_plugins += [dep]
if plugin.name().startswith('gst')
plugin_names += [plugin.name().substring(3)]
else

View file

@ -321,7 +321,11 @@ endif
configure_file(output : 'config.h', configuration : cdata)
plugin_names = []
gst_plugins = []
foreach plugin: plugins
dep = declare_dependency(link_with: plugin, variables: {'full_path': plugin.full_path()})
meson.override_dependency(plugin.name(), dep)
gst_plugins += [dep]
if plugin.name().startswith('gst')
plugin_names += [plugin.name().substring(3)]
else

View file

@ -212,3 +212,20 @@ if gst_version_nano == 0
endif
configure_file(output: 'config.h', configuration: cdata)
plugin_names = []
gst_plugins = []
foreach plugin: plugins
dep = declare_dependency(link_with: plugin, variables: {'full_path': plugin.full_path()})
meson.override_dependency(plugin.name(), dep)
gst_plugins += [dep]
if plugin.name().startswith('gst')
plugin_names += [plugin.name().substring(3)]
else
plugin_names += [plugin.name()]
endif
endforeach
summary({
'Plugins': plugin_names,
}, list_sep: ', ')

View file

@ -236,3 +236,23 @@ if gmodule_dep.version().version_compare('< 2.67.4')
endif
configure_file(output: 'config.h', configuration: cdata)
pkgconfig = import('pkgconfig')
plugins_pkgconfig_install_dir = join_paths(plugins_install_dir, 'pkgconfig')
plugin_names = []
gst_plugins = []
foreach plugin: plugins
dep = declare_dependency(link_with: plugin, variables: {'full_path': plugin.full_path()})
meson.override_dependency(plugin.name(), dep)
gst_plugins += [dep]
if plugin.name().startswith('gst')
plugin_names += [plugin.name().substring(3)]
else
plugin_names += [plugin.name()]
endif
endforeach
summary({
'Plugins': plugin_names,
}, list_sep: ', ')

View file

@ -653,7 +653,11 @@ configure_file(output : 'config.h', configuration : cdata)
install_data('gst-element-check-1.0.m4', install_dir : join_paths(get_option('datadir'), 'aclocal'))
plugin_names = []
gst_plugins = []
foreach plugin: plugins
dep = declare_dependency(link_with: plugin, variables: {'full_path': plugin.full_path()})
meson.override_dependency(plugin.name(), dep)
gst_plugins += [dep]
if plugin.name().startswith('gst')
plugin_names += [plugin.name().substring(3)]
else