mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-11-15 23:01:02 +00:00
meson: Disable plugins and related outputs if features are disabled
Previously, there was no check performed on features of plugins if these specify GStreamer plugins. This commit adds that, and ensures that the plugins and pkg-config targets are skipped if no outputs are to be generated (this is already done for examples). Closes #369 Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1327>
This commit is contained in:
parent
d6f42a2037
commit
31ad311d7f
1 changed files with 70 additions and 53 deletions
123
meson.build
123
meson.build
|
@ -142,21 +142,6 @@ plugins = {
|
||||||
'regex': {'library': 'libgstregex'},
|
'regex': {'library': 'libgstregex'},
|
||||||
'textwrap': {'library': 'libgsttextwrap'},
|
'textwrap': {'library': 'libgsttextwrap'},
|
||||||
|
|
||||||
'fallbackswitch': {
|
|
||||||
'library': 'libgstfallbackswitch',
|
|
||||||
'examples': ['gtk-fallbackswitch'],
|
|
||||||
'features': ['gtk', 'gio', 'gst-plugin-gtk4'],
|
|
||||||
},
|
|
||||||
'livesync': {
|
|
||||||
'library': 'libgstlivesync',
|
|
||||||
'examples': ['gtk-livesync'],
|
|
||||||
'features': ['gtk', 'gio', 'gst-plugin-gtk4'],
|
|
||||||
},
|
|
||||||
'togglerecord': {
|
|
||||||
'library': 'libgsttogglerecord',
|
|
||||||
'examples': ['gtk-recording'],
|
|
||||||
'features': ['gtk', 'gio', 'gst-plugin-gtk4'],
|
|
||||||
},
|
|
||||||
'tracers': {'library': 'libgstrstracers'},
|
'tracers': {'library': 'libgstrstracers'},
|
||||||
'uriplaylistbin': {
|
'uriplaylistbin': {
|
||||||
'library': 'libgsturiplaylistbin',
|
'library': 'libgsturiplaylistbin',
|
||||||
|
@ -263,12 +248,29 @@ if get_option('gtk4').allowed()
|
||||||
gtk4_features += 'x11glx'
|
gtk4_features += 'x11glx'
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
plugins += {'gtk4': {
|
plugins += {
|
||||||
'library': 'libgstgtk4',
|
'gtk4': {
|
||||||
'examples': ['gtksink'],
|
'library': 'libgstgtk4',
|
||||||
'extra-deps': {'gtk4': '>=4.6'},
|
'examples': ['gtksink'],
|
||||||
'features': gtk4_features,
|
'extra-deps': {'gtk4': '>=4.6'},
|
||||||
}}
|
'features': gtk4_features,
|
||||||
|
},
|
||||||
|
'fallbackswitch': {
|
||||||
|
'library': 'libgstfallbackswitch',
|
||||||
|
'examples': ['gtk-fallbackswitch'],
|
||||||
|
'features': ['gtk', 'gio', 'gst-plugin-gtk4'],
|
||||||
|
},
|
||||||
|
'livesync': {
|
||||||
|
'library': 'libgstlivesync',
|
||||||
|
'examples': ['gtk-livesync'],
|
||||||
|
'features': ['gtk', 'gio', 'gst-plugin-gtk4'],
|
||||||
|
},
|
||||||
|
'togglerecord': {
|
||||||
|
'library': 'libgsttogglerecord',
|
||||||
|
'examples': ['gtk-recording'],
|
||||||
|
'features': ['gtk', 'gio', 'gst-plugin-gtk4'],
|
||||||
|
},
|
||||||
|
}
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Process plugins list
|
# Process plugins list
|
||||||
|
@ -331,11 +333,22 @@ foreach plugin_name, details: plugins
|
||||||
deps_cache += {dep_name: dep}
|
deps_cache += {dep_name: dep}
|
||||||
if not dep.found()
|
if not dep.found()
|
||||||
plugin_deps_found = false
|
plugin_deps_found = false
|
||||||
|
break
|
||||||
endif
|
endif
|
||||||
endforeach
|
endforeach
|
||||||
|
plugin_features = details.get('features', [])
|
||||||
|
if plugin_deps_found
|
||||||
|
# Validate gst-plugin features
|
||||||
|
foreach feature: features
|
||||||
|
if feature.startswith('gst-plugin') and not packages.contains(feature)
|
||||||
|
plugin_deps_found = false
|
||||||
|
break
|
||||||
|
endif
|
||||||
|
endforeach
|
||||||
|
endif
|
||||||
if plugin_deps_found
|
if plugin_deps_found
|
||||||
packages += f'gst-plugin-@plugin_name@'
|
packages += f'gst-plugin-@plugin_name@'
|
||||||
features += details.get('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,
|
||||||
'--feature', '--gst-version', gst_dep.version(), capture: true, check: true).stdout().strip()
|
'--feature', '--gst-version', gst_dep.version(), capture: true, check: true).stdout().strip()
|
||||||
if extra_features != ''
|
if extra_features != ''
|
||||||
|
@ -385,29 +398,31 @@ endif
|
||||||
# get cmdline for rust
|
# get cmdline for rust
|
||||||
extra_env += {'RUSTC': ' '.join(rustc.cmd_array())}
|
extra_env += {'RUSTC': ' '.join(rustc.cmd_array())}
|
||||||
|
|
||||||
rs_plugins = custom_target('gst-plugins-rs',
|
plugins = []
|
||||||
build_by_default: true,
|
if output.length() > 0
|
||||||
output: output,
|
rs_plugins = custom_target('gst-plugins-rs',
|
||||||
console: true,
|
build_by_default: true,
|
||||||
install: true,
|
output: output,
|
||||||
install_dir: plugins_install_dir,
|
console: true,
|
||||||
depends: depends,
|
install: true,
|
||||||
depfile: 'gst-plugins-rs.dep',
|
install_dir: plugins_install_dir,
|
||||||
env: extra_env,
|
depends: depends,
|
||||||
command: [cargo_wrapper,
|
depfile: 'gst-plugins-rs.dep',
|
||||||
'build',
|
env: extra_env,
|
||||||
meson.current_build_dir(),
|
command: [cargo_wrapper,
|
||||||
meson.current_source_dir(),
|
'build',
|
||||||
meson.global_build_root(),
|
meson.current_build_dir(),
|
||||||
target,
|
meson.current_source_dir(),
|
||||||
get_option('prefix'),
|
meson.global_build_root(),
|
||||||
get_option('libdir'),
|
target,
|
||||||
'--packages', packages,
|
get_option('prefix'),
|
||||||
'--depfile', '@DEPFILE@',
|
get_option('libdir'),
|
||||||
'--lib-suffixes', library_suffixes,
|
'--packages', packages,
|
||||||
] + feature_args + extra_args)
|
'--depfile', '@DEPFILE@',
|
||||||
|
'--lib-suffixes', library_suffixes,
|
||||||
plugins = rs_plugins.to_list()
|
] + feature_args + extra_args)
|
||||||
|
plugins = rs_plugins.to_list()
|
||||||
|
endif
|
||||||
|
|
||||||
# This is used by GStreamer to static link Rust plugins into gst-full
|
# This is used by GStreamer to static link Rust plugins into gst-full
|
||||||
gst_plugins = []
|
gst_plugins = []
|
||||||
|
@ -476,14 +491,16 @@ subdir('docs')
|
||||||
# We don't need to pass a command as we depends on the target above
|
# We don't need to pass a command as we depends on the target above
|
||||||
# but it is currently mandatory ( https://github.com/mesonbuild/meson/issues/8059 )
|
# but it is currently mandatory ( https://github.com/mesonbuild/meson/issues/8059 )
|
||||||
# so use python as it's guaranteed to be present on any setup
|
# so use python as it's guaranteed to be present on any setup
|
||||||
custom_target('gst-plugins-rs-pc-files',
|
if pc_files.length() > 0
|
||||||
build_by_default: true,
|
custom_target('gst-plugins-rs-pc-files',
|
||||||
output: pc_files,
|
build_by_default: true,
|
||||||
console: true,
|
output: pc_files,
|
||||||
install: true,
|
console: true,
|
||||||
install_dir: pkgconfig_install_dir,
|
install: true,
|
||||||
depends: rs_plugins,
|
install_dir: pkgconfig_install_dir,
|
||||||
command: [python, '-c', '""'])
|
depends: rs_plugins,
|
||||||
|
command: [python, '-c', '""'])
|
||||||
|
endif
|
||||||
|
|
||||||
if get_option('webrtc').allowed()
|
if get_option('webrtc').allowed()
|
||||||
custom_target('gst-webrtc-signalling-server',
|
custom_target('gst-webrtc-signalling-server',
|
||||||
|
|
Loading…
Reference in a new issue