Merge commit '8830dccd1d
' into sync_cg_clif-2023-06-15
This commit is contained in:
commit
82b497286d
56 changed files with 2511 additions and 592 deletions
|
@ -12,24 +12,33 @@ fn main() {
|
|||
|
||||
let mut rustflags = String::new();
|
||||
rustflags.push_str(" -Cpanic=abort -Zpanic-abort-tests -Zcodegen-backend=");
|
||||
rustflags.push_str(
|
||||
sysroot
|
||||
.join(if cfg!(windows) { "bin" } else { "lib" })
|
||||
.join(
|
||||
env::consts::DLL_PREFIX.to_string()
|
||||
+ "rustc_codegen_cranelift"
|
||||
+ env::consts::DLL_SUFFIX,
|
||||
)
|
||||
.to_str()
|
||||
.unwrap(),
|
||||
);
|
||||
if let Some(name) = option_env!("BUILTIN_BACKEND") {
|
||||
rustflags.push_str(name);
|
||||
} else {
|
||||
rustflags.push_str(
|
||||
sysroot
|
||||
.join(if cfg!(windows) { "bin" } else { "lib" })
|
||||
.join(
|
||||
env::consts::DLL_PREFIX.to_string()
|
||||
+ "rustc_codegen_cranelift"
|
||||
+ env::consts::DLL_SUFFIX,
|
||||
)
|
||||
.to_str()
|
||||
.unwrap(),
|
||||
);
|
||||
}
|
||||
rustflags.push_str(" --sysroot ");
|
||||
rustflags.push_str(sysroot.to_str().unwrap());
|
||||
env::set_var("RUSTFLAGS", env::var("RUSTFLAGS").unwrap_or(String::new()) + &rustflags);
|
||||
env::set_var("RUSTDOCFLAGS", env::var("RUSTDOCFLAGS").unwrap_or(String::new()) + &rustflags);
|
||||
|
||||
// Ensure that the right toolchain is used
|
||||
env::set_var("RUSTUP_TOOLCHAIN", env!("TOOLCHAIN_NAME"));
|
||||
let cargo = if let Some(cargo) = option_env!("CARGO") {
|
||||
cargo
|
||||
} else {
|
||||
// Ensure that the right toolchain is used
|
||||
env::set_var("RUSTUP_TOOLCHAIN", option_env!("TOOLCHAIN_NAME").expect("TOOLCHAIN_NAME"));
|
||||
"cargo"
|
||||
};
|
||||
|
||||
let args: Vec<_> = match env::args().nth(1).as_deref() {
|
||||
Some("jit") => {
|
||||
|
@ -64,10 +73,10 @@ fn main() {
|
|||
};
|
||||
|
||||
#[cfg(unix)]
|
||||
panic!("Failed to spawn cargo: {}", Command::new("cargo").args(args).exec());
|
||||
panic!("Failed to spawn cargo: {}", Command::new(cargo).args(args).exec());
|
||||
|
||||
#[cfg(not(unix))]
|
||||
std::process::exit(
|
||||
Command::new("cargo").args(args).spawn().unwrap().wait().unwrap().code().unwrap_or(1),
|
||||
Command::new(cargo).args(args).spawn().unwrap().wait().unwrap().code().unwrap_or(1),
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue