Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I configure cargo to build projects to a specific directory?

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?

like image 406
ferd tomale Avatar asked Nov 07 '25 08:11

ferd tomale


1 Answers

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

like image 92
subbu963 Avatar answered Nov 10 '25 03:11

subbu963



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!