diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.com> | 2020-11-16 17:23:51 +0300 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.com> | 2020-11-16 17:30:32 +0300 |
commit | b9f8ce999538aa1a8880a8e41202b9e70f514e71 (patch) | |
tree | d17e40f13e35a42c28a343afdb30af1cdbe54c38 /meson.build | |
parent | 717477fd36f00c5f1b8dbb64ec4dadc602d5fc22 (diff) |
meson: add support for static build
There is no way to dynamically ask Cargo to build static or dynamic lib
so we have to build both and pick the one we care when doing the meson
processing.
Fix #88
Diffstat (limited to 'meson.build')
-rw-r--r-- | meson.build | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/meson.build b/meson.build index ba36b173d..4ef622fba 100644 --- a/meson.build +++ b/meson.build @@ -15,11 +15,14 @@ cargo_wrapper = find_program('cargo_wrapper.py') system = build_machine.system() if system == 'windows' - ext = 'dll' + ext_dynamic = 'dll' + ext_static = 'lib' elif system == 'darwin' - ext = 'dylib' + ext_dynamic = 'dylib' + ext_static = 'a' else - ext = 'so' + ext_dynamic = 'so' + ext_static = 'a' endif plugins_rep = { @@ -82,10 +85,22 @@ endif output = [] -foreach p, lib : plugins_rep - # Add the plugin file as output - output += [lib + '.' + ext] -endforeach +extensions = [] + +# Add the plugin file as output +if get_option('default_library') == 'shared' or get_option('default_library') == 'both' + extensions += [ext_dynamic] + foreach p, lib : plugins_rep + output += [lib + '.' + ext_dynamic] + endforeach +endif + +if get_option('default_library') == 'static' or get_option('default_library') == 'both' + extensions += [ext_static] + foreach p, lib : plugins_rep + output += [lib + '.' + ext_static] + endforeach +endif # Need to depends on all gstreamer-rs deps to ensure they are built # before gstreamer-rs when building with gst-build. @@ -143,7 +158,7 @@ rs_plugins = custom_target('gst-plugins-rs', target, exclude, extra_env_str, - ext]) + extensions]) # 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 |