Allow users to enable local incremental Rust builds
This CL allows users to set the SOONG_RUSTC_INCREMENTAL environment variable to enable incremental Rust builds. The out/soong/rustc directory is used for intermediate artifacts. Test: m rust Change-Id: Ica2587c30596325b7d3e82d8e3c1d610b92718b8
This commit is contained in:
parent
23d5d986fe
commit
d9781fd67e
1 changed files with 7 additions and 0 deletions
|
@ -216,6 +216,13 @@ func transformSrctoCrate(ctx ModuleContext, main android.Path, deps PathDeps, fl
|
|||
// Suppress an implicit sysroot
|
||||
rustcFlags = append(rustcFlags, "--sysroot=/dev/null")
|
||||
|
||||
// Enable incremental compilation if requested by user
|
||||
if ctx.Config().IsEnvTrue("SOONG_RUSTC_INCREMENTAL") {
|
||||
incrementalPath := android.PathForOutput(ctx, "rustc").String()
|
||||
|
||||
rustcFlags = append(rustcFlags, "-C incremental="+incrementalPath)
|
||||
}
|
||||
|
||||
// Collect linker flags
|
||||
linkFlags = append(linkFlags, flags.GlobalLinkFlags...)
|
||||
linkFlags = append(linkFlags, flags.LinkFlags...)
|
||||
|
|
Loading…
Reference in a new issue