Skip to content

Commit

Permalink
feat(zenoh-plugin-zenoh-flow): provide "dynamic_plugin" feature
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
J-Loudet committed May 24, 2024
1 parent db2d477 commit 6ea5296
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions zenoh-plugin-zenoh-flow/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions zenoh-plugin-zenoh-flow/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}
Expand Down

0 comments on commit 6ea5296

Please sign in to comment.