From 4fc55865bc526230c21cfafa24c9242d53291151 Mon Sep 17 00:00:00 2001 From: Julien Loudet Date: Fri, 24 May 2024 17:19:46 +0200 Subject: [PATCH] feat(zenoh-plugin-zenoh-flow): provide "dynamic_plugin" feature Having this feature and, in particular, the ability to disable it, allows statically linking the Zenoh-Flow plugin to Zenoh. This feature is enabled by default. * zenoh-plugin-zenoh-flow/Cargo.toml: added the `dynamic_plugin` feature. * zenoh-plugin-zenoh-flow/src/lib.rs: only call the macro `declare_plugin!` if the feature `dynamic_plugin` is enabled. Signed-off-by: Julien Loudet --- zenoh-plugin-zenoh-flow/Cargo.toml | 4 ++++ zenoh-plugin-zenoh-flow/src/lib.rs | 1 + 2 files changed, 5 insertions(+) diff --git a/zenoh-plugin-zenoh-flow/Cargo.toml b/zenoh-plugin-zenoh-flow/Cargo.toml index cdbf8c88..90982704 100644 --- a/zenoh-plugin-zenoh-flow/Cargo.toml +++ b/zenoh-plugin-zenoh-flow/Cargo.toml @@ -23,6 +23,10 @@ name = "zenoh-plugin-zenoh-flow" repository = { workspace = true } version = { workspace = true } +[features] +dynamic_plugin = [] +default = ["dynamic_plugin"] + [lib] crate-type = ["cdylib"] name = "zenoh_plugin_zenoh_flow" diff --git a/zenoh-plugin-zenoh-flow/src/lib.rs b/zenoh-plugin-zenoh-flow/src/lib.rs index 1c0a2b2a..71841740 100644 --- a/zenoh-plugin-zenoh-flow/src/lib.rs +++ b/zenoh-plugin-zenoh-flow/src/lib.rs @@ -27,6 +27,7 @@ pub struct ZenohFlowPlugin(Sender<()>); pub const GIT_VERSION: &str = git_version::git_version!(prefix = "v", cargo_prefix = "v"); +#[cfg(feature = "dynamic_plugin")] zenoh_plugin_trait::declare_plugin!(ZenohFlowPlugin); impl ZenohPlugin for ZenohFlowPlugin {}