mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2025-01-08 10:15:29 +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/1614>
This commit is contained in:
parent
46094f8e40
commit
2478b47445
1 changed files with 57 additions and 43 deletions
100
meson.build
100
meson.build
|
@ -390,51 +390,65 @@ 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()
|
||||||
plugin_deps_found = true
|
debug(f'@plugin_name@ is disabled')
|
||||||
foreach dep_name, dep_ver: details.get('extra-deps', {})
|
continue
|
||||||
if dep_ver.length() != 0
|
endif
|
||||||
dep = dependency(dep_name, version: dep_ver, required: plugin_opt)
|
plugin_deps_found = true
|
||||||
else
|
|
||||||
dep = dependency(dep_name, required: plugin_opt)
|
|
||||||
endif
|
|
||||||
deps_cache += {dep_name: dep}
|
|
||||||
if not dep.found()
|
|
||||||
plugin_deps_found = false
|
|
||||||
break
|
|
||||||
endif
|
|
||||||
endforeach
|
|
||||||
plugin_features = details.get('features', [])
|
|
||||||
if plugin_deps_found
|
|
||||||
# Validate gst-plugin features
|
|
||||||
foreach feature: plugin_features
|
|
||||||
if feature.startswith('gst-plugin') and not packages.contains(feature)
|
|
||||||
plugin_deps_found = false
|
|
||||||
break
|
|
||||||
endif
|
|
||||||
endforeach
|
|
||||||
endif
|
|
||||||
if plugin_deps_found
|
|
||||||
packages += f'gst-plugin-@plugin_name@'
|
|
||||||
features += plugin_features
|
|
||||||
extra_features = run_command('dependencies.py', meson.current_source_dir(), plugin_name,
|
|
||||||
'--feature', '--gst-version', gst_dep.version(), capture: true, check: true).stdout().strip()
|
|
||||||
if extra_features != ''
|
|
||||||
features += extra_features.split(',')
|
|
||||||
endif
|
|
||||||
|
|
||||||
lib = details.get('library')
|
# Check whether we have all needed deps
|
||||||
# No 'lib' suffix with MSVC
|
foreach dep_name, dep_ver: details.get('extra-deps', {})
|
||||||
if cc.get_argument_syntax() == 'msvc'
|
if dep_ver.length() != 0
|
||||||
lib = lib.substring(3)
|
dep = dependency(dep_name, version: dep_ver, required: plugin_opt)
|
||||||
endif
|
else
|
||||||
if default_library in ['shared', 'both']
|
dep = dependency(dep_name, required: plugin_opt)
|
||||||
output += [lib + '.' + ext_dynamic]
|
|
||||||
endif
|
|
||||||
if default_library in ['static', 'both']
|
|
||||||
output += [lib + '.' + ext_static]
|
|
||||||
endif
|
|
||||||
endif
|
endif
|
||||||
|
deps_cache += {dep_name: dep}
|
||||||
|
if not dep.found()
|
||||||
|
debug(f'@plugin_name@ dependency @dep_name@ @dep_ver@ not found, skipping')
|
||||||
|
plugin_deps_found = false
|
||||||
|
break
|
||||||
|
endif
|
||||||
|
endforeach
|
||||||
|
if not plugin_deps_found
|
||||||
|
continue
|
||||||
|
endif
|
||||||
|
|
||||||
|
# Validate gst-plugin features
|
||||||
|
plugin_features = details.get('features', [])
|
||||||
|
foreach feature: plugin_features
|
||||||
|
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
|
||||||
|
break
|
||||||
|
endif
|
||||||
|
endforeach
|
||||||
|
if not plugin_deps_found
|
||||||
|
continue
|
||||||
|
endif
|
||||||
|
|
||||||
|
packages += f'gst-plugin-@plugin_name@'
|
||||||
|
features += plugin_features
|
||||||
|
extra_features = run_command('dependencies.py', meson.current_source_dir(), plugin_name,
|
||||||
|
'--feature', '--gst-version', gst_dep.version(), capture: true, check: true).stdout().strip()
|
||||||
|
if extra_features != ''
|
||||||
|
features += extra_features.split(',')
|
||||||
|
endif
|
||||||
|
|
||||||
|
lib = details.get('library')
|
||||||
|
# No 'lib' suffix with MSVC
|
||||||
|
if cc.get_argument_syntax() == 'msvc'
|
||||||
|
lib = lib.substring(3)
|
||||||
|
endif
|
||||||
|
if default_library in ['shared', 'both']
|
||||||
|
output += [lib + '.' + ext_dynamic]
|
||||||
|
endif
|
||||||
|
if default_library in ['static', 'both']
|
||||||
|
output += [lib + '.' + ext_static]
|
||||||
endif
|
endif
|
||||||
endforeach
|
endforeach
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue