[How to] define crate per binary build targets

Can you tell me how can I do something like this ? thanks

[dependencies]
tokio = "0.1" # for both build targets

[[bin]]
name = "bootstrap"
path = "src/main.rs"

[[bin]]
name = "development"
path = "src/development.rs"
actix-web = "1.0" # only download when build development

You could make some dependencies optional, and add required-features for some binaries.

Otherwise, if the dependencies aren't the same, you have to use a workspace and split them into multiple sub-crates.

thank you, sub-crates seem to be the answer

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.