Allow preserving the old sysroot
This commit is contained in:
parent
ad971bbed7
commit
0d6b3dab65
@ -121,11 +121,14 @@ pub(crate) fn build_sysroot(
|
||||
fn build_clif_sysroot_for_triple(channel: &str, target_dir: &Path, triple: &str) {
|
||||
let build_dir = Path::new("build_sysroot").join("target").join(triple).join(channel);
|
||||
|
||||
// FIXME add option to skip this
|
||||
// Cleanup the target dir with the exception of build scripts and the incremental cache
|
||||
for dir in ["build", "deps", "examples", "native"] {
|
||||
if build_dir.join(dir).exists() {
|
||||
fs::remove_dir_all(build_dir.join(dir)).unwrap();
|
||||
let keep_sysroot =
|
||||
fs::read_to_string("config.txt").unwrap().lines().any(|line| line.trim() == "keep_sysroot");
|
||||
if !keep_sysroot {
|
||||
// Cleanup the target dir with the exception of build scripts and the incremental cache
|
||||
for dir in ["build", "deps", "examples", "native"] {
|
||||
if build_dir.join(dir).exists() {
|
||||
fs::remove_dir_all(build_dir.join(dir)).unwrap();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
7
config.txt
Normal file
7
config.txt
Normal file
@ -0,0 +1,7 @@
|
||||
# This file allows configuring the build system.
|
||||
|
||||
# Disables cleaning of the sysroot dir. This will cause old compiled artifacts to be re-used when
|
||||
# the sysroot source hasn't changed. This is useful when the codegen backend hasn't been modified.
|
||||
# This option can be changed while the build system is already running for as long as sysroot
|
||||
# building hasn't started yet.
|
||||
#keep_sysroot
|
Loading…
x
Reference in New Issue
Block a user