mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2025-01-05 16:58:40 +00:00
meson: Fix plugin requirement checking and add logging
We were silently skipping plugins that didn't find a required feature, even if the plugin option was enabled. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1604>
This commit is contained in:
parent
39f466f2c6
commit
968e0fddb9
1 changed files with 68 additions and 55 deletions
43
meson.build
43
meson.build
|
@ -394,8 +394,13 @@ endif
|
||||||
|
|
||||||
foreach plugin_name, details: plugins
|
foreach plugin_name, details: plugins
|
||||||
plugin_opt = get_variable(f'@plugin_name@_option', get_option(plugin_name))
|
plugin_opt = get_variable(f'@plugin_name@_option', get_option(plugin_name))
|
||||||
if plugin_opt.allowed()
|
if not plugin_opt.allowed()
|
||||||
|
debug(f'@plugin_name@ is disabled')
|
||||||
|
continue
|
||||||
|
endif
|
||||||
plugin_deps_found = true
|
plugin_deps_found = true
|
||||||
|
|
||||||
|
# Check whether we have all needed deps
|
||||||
foreach dep_name, dep_ver: details.get('extra-deps', {})
|
foreach dep_name, dep_ver: details.get('extra-deps', {})
|
||||||
if dep_ver.length() != 0
|
if dep_ver.length() != 0
|
||||||
dep = dependency(dep_name, version: dep_ver, required: plugin_opt)
|
dep = dependency(dep_name, version: dep_ver, required: plugin_opt)
|
||||||
|
@ -404,33 +409,43 @@ foreach plugin_name, details: plugins
|
||||||
endif
|
endif
|
||||||
deps_cache += {dep_name: dep}
|
deps_cache += {dep_name: dep}
|
||||||
if not dep.found()
|
if not dep.found()
|
||||||
|
debug(f'@plugin_name@ dependency @dep_name@ @dep_ver@ not found, skipping')
|
||||||
plugin_deps_found = false
|
plugin_deps_found = false
|
||||||
break
|
break
|
||||||
endif
|
endif
|
||||||
endforeach
|
endforeach
|
||||||
plugin_features = details.get('features', [])
|
if not plugin_deps_found
|
||||||
if plugin_deps_found
|
continue
|
||||||
|
endif
|
||||||
|
|
||||||
# Validate gst-plugin features
|
# Validate gst-plugin features
|
||||||
|
plugin_features = details.get('features', [])
|
||||||
foreach feature: plugin_features
|
foreach feature: plugin_features
|
||||||
if feature.startswith('gst-plugin') and not packages.contains(feature)
|
if feature.startswith('gst-plugin') and not packages.contains(feature)
|
||||||
|
msg = f'@plugin_name@ required feature @feature@ not found'
|
||||||
|
if plugin_opt.enabled()
|
||||||
|
error(msg)
|
||||||
|
endif
|
||||||
|
message(msg + ', skipping')
|
||||||
plugin_deps_found = false
|
plugin_deps_found = false
|
||||||
break
|
break
|
||||||
endif
|
endif
|
||||||
endforeach
|
endforeach
|
||||||
|
if not plugin_deps_found
|
||||||
|
continue
|
||||||
endif
|
endif
|
||||||
if details.has_key('gst-version')
|
|
||||||
# Check if we have the required GStreamer version
|
# Check if we have the required GStreamer version
|
||||||
gst_version = details.get('gst-version', '')
|
if details.has_key('gst-version') and not \
|
||||||
dep = dependency('gstreamer-1.0', required: false, version: gst_version)
|
deps_cache['gstreamer-1.0'].version().version_compare(details['gst-version'])
|
||||||
if not dep.found()
|
msg = '@0@ requires gstreamer version @1@'.format(plugin_name, details['gst-version'])
|
||||||
opt = get_option(plugin_name)
|
if plugin_opt.enabled()
|
||||||
if opt.enabled()
|
error(msg)
|
||||||
error('Required GStreamer version not found to build ' + plugin_name)
|
|
||||||
endif
|
endif
|
||||||
plugin_deps_found = false
|
message(msg + ', skipping')
|
||||||
|
continue
|
||||||
endif
|
endif
|
||||||
endif
|
|
||||||
if plugin_deps_found
|
|
||||||
packages += f'gst-plugin-@plugin_name@'
|
packages += f'gst-plugin-@plugin_name@'
|
||||||
features += plugin_features
|
features += plugin_features
|
||||||
extra_features = run_command('dependencies.py', meson.current_source_dir(), plugin_name,
|
extra_features = run_command('dependencies.py', meson.current_source_dir(), plugin_name,
|
||||||
|
@ -450,8 +465,6 @@ foreach plugin_name, details: plugins
|
||||||
if default_library in ['static', 'both']
|
if default_library in ['static', 'both']
|
||||||
output += [lib + '.' + ext_static]
|
output += [lib + '.' + ext_static]
|
||||||
endif
|
endif
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endforeach
|
endforeach
|
||||||
|
|
||||||
feature_args = []
|
feature_args = []
|
||||||
|
|
Loading…
Reference in a new issue