How can I build multiple binaries with Cargo?
@lebyy▲ 0 net votes
Problem: I'd like to make a project with a daemon and a client , connecting through a unix socket. A client and a daemon requires two binaries, so how do I tell Cargo to build two targets from two different sources? To add a bit of fantasy, I'd like to have a library… Fix (from the top answer): You can specify multiple binaries using [[bin]] , as mentioned in the Cargo Book [[bin]] name = "daemon" path = "src/daemon/bin/main.rs" [[bin]] name = "client" path = &qu You can run individual binaries with the cargo run command with the --bin <bin-name> option. Tip: If you instead put these files in…