With Cargo, I can set a project's development settings to use parallel code generation:
[profile.dev]
codegen-units = 8
According to the documentation, it should be possible to put this into ~/.cargo/config
to apply this setting to all projects. This doesn't work for me: it seems that the .cargo/config
file isn't used at all. Is there any way to apply such configuration to every project I compile?
You can set rustflags for all builds or per target in your
.cargo/config
file.To be clear, this will set the codegen-units for all your projects (covered by this .cargo/config) regardless of profile.
To make sure it's actually set, you can also set verbose output in the same file. This will show each rustc command with flags that cargo invokes.
A workaround is to create a script to be called instead of
cargo
If you use the full path to
cargo
on the script, you can create a aliasand just call
cargo
.