Reputation: 520
In Rust 1.52.1 incremental compilation is disabled, but I want to enable it because it speeds up my compilation time by 3 times.
There are RUSTC_FORCE_INCREMENTAL
environmental variable for it. So I want to set RUSTC_FORCE_INCREMENTAL=1
for build task, but it seems CLion doesn't support that. I can only set environmental variables for Run Configurations.
Upvotes: 1
Views: 1193
Reputation: 520
Use a build script: place a build.rs
file in the root of your package and use cargo:rustc-env=VAR=VALUE
instruction:
fn main() {
println!("cargo:rustc-env=RUSTC_FORCE_INCREMENTAL=1");
}
Upvotes: 1