Reputation: 903
I am creating an application that will allow plugins to add/modify features. For now it is cli application with multiple plugins for the data backends. Each plugin is implemented as a different project in a cargo workspace. How do I configure cargo or the package manifest to build the library project into a subdirectory where the output directory of the build is found?
Upvotes: 4
Views: 2591
Reputation: 21
A small correction to @Fabian's answer, we need to add the following config to .cargo/config.toml
folder in your rust project's folder or in your home folder.
[build]
target-dir = "/some/directory/rust-builds"
You can also add other configuration which are mentioned here - https://doc.rust-lang.org/cargo/reference/config.html
Upvotes: 2
Reputation: 1794
Add the following to your Cargo.toml
:
[build]
target-dir = "/desired/path" # path of where to place all generated artifacts
Source: https://doc.rust-lang.org/cargo/reference/config.html
Also read: https://doc.rust-lang.org/cargo/commands/cargo-build.html#output-options
Upvotes: 1