diff --git a/cargo.py b/cargo.py index 73d43113..3e8bdef8 100644 --- a/cargo.py +++ b/cargo.py @@ -7,7 +7,7 @@ import shutil import subprocess import sys -meson_build_dir, meson_current_source_dir, meson_build_root, target, ext = sys.argv[1:] +meson_build_dir, meson_current_source_dir, meson_build_root, target, ext, exclude = sys.argv[1:] cargo_target_dir = os.path.join(meson_build_dir, 'target') @@ -27,10 +27,15 @@ env['PKG_CONFIG_PATH'] = ':'.join(pkg_config_path) # cargo build cargo_cmd = ['cargo', 'build', '--manifest-path', - os.path.join(meson_current_source_dir, 'Cargo.toml')] + os.path.join(meson_current_source_dir, 'Cargo.toml'), + '--workspace'] if target == 'release': cargo_cmd.append('--release') +for e in exclude.split(','): + cargo_cmd.append('--exclude') + cargo_cmd.append(e) + try: subprocess.run(cargo_cmd, env=env, check=True) except subprocess.SubprocessError: diff --git a/meson.build b/meson.build index 47dd6029..c783d60c 100644 --- a/meson.build +++ b/meson.build @@ -25,7 +25,6 @@ plugins_rep = { 'gst-plugin-audiofx': 'libgstrsaudiofx', 'gst-plugin-cdg': 'libgstcdg', 'gst-plugin-closedcaption': 'libgstrsclosedcaption', - 'gst-plugin-dav1d': 'libgstrsdav1d', 'gst-plugin-fallbackswitch': 'libgstfallbackswitch', 'gst-plugin-file': 'libgstrsfile', 'gst-plugin-flv': 'libgstrsflv', @@ -38,6 +37,14 @@ plugins_rep = { 'gst-plugin-togglerecord': 'libgsttogglerecord', } +exclude = [] + +if dependency('dav1d', required : false).found() + plugins_rep += {'gst-plugin-dav1d' : 'libgstrsdav1d'} +else + exclude += ['gst-plugin-dav1d'] +endif + output = [] foreach p, lib : plugins_rep @@ -86,7 +93,8 @@ rs_plugins = custom_target('gst-plugins-rs', meson.current_source_dir(), meson.build_root(), target, - ext]) + ext, + ','.join(exclude)]) # FIXME: raises a warning as the target has multiple outputs and meson will use # only the first one. All the plugins have the same basedir, hence