Allow testing a cranelift backend built into rustc itself
This avoids building cranelift twice in rust's CI and is a lot easier than trying to make building of codegen backends work from within a cargo invocation done by rust's build system.
This commit is contained in:
parent
c87dfd9c9d
commit
5b3bc29008
8 changed files with 101 additions and 48 deletions
|
@ -19,9 +19,13 @@ fn main() {
|
|||
let mut args = vec![];
|
||||
args.push(OsString::from("-Cpanic=abort"));
|
||||
args.push(OsString::from("-Zpanic-abort-tests"));
|
||||
let mut codegen_backend_arg = OsString::from("-Zcodegen-backend=");
|
||||
codegen_backend_arg.push(cg_clif_dylib_path);
|
||||
args.push(codegen_backend_arg);
|
||||
if let Some(name) = option_env!("BUILTIN_BACKEND") {
|
||||
args.push(OsString::from(format!("-Zcodegen-backend={name}")))
|
||||
} else {
|
||||
let mut codegen_backend_arg = OsString::from("-Zcodegen-backend=");
|
||||
codegen_backend_arg.push(cg_clif_dylib_path);
|
||||
args.push(codegen_backend_arg);
|
||||
}
|
||||
if !passed_args.iter().any(|arg| {
|
||||
arg == "--sysroot" || arg.to_str().map(|s| s.starts_with("--sysroot=")) == Some(true)
|
||||
}) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue