[英]Is there a way to specify that one executable depends on another in Cargo.toml?
我有一个带有两个可执行文件的 Rust 项目:
src
└── bin
├── app.rs
└── tool.rs
tool
程序作为app
的子进程运行。 (需要分离,因为tool
的运行权限与app
不同。)
要运行app
,我需要首先确保已构建该tool
,因此我目前正在执行以下操作:
cargo build && cargo run --bin app
理想情况下,我可以向我的Cargo.toml
添加一些东西,以便它知道该app
依赖于正在构建的tool
,这样我就可以运行它:
cargo run --bin app
有没有办法做到这一点?
目前不是,没有 hacky 方法,但有一些正在进行的工作正在接近: https://github.com/rust-lang/cargo/issues/9096
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.