Rollup merge of #116793 - WaffleLapkin:target_rules_the_backend, r=cjgillot
Allow targets to override default codegen backend Implements https://github.com/rust-lang/compiler-team/issues/670.
This commit is contained in:
commit
86af4d25a5
8 changed files with 117 additions and 59 deletions
|
@ -193,6 +193,12 @@ pub fn sysroot_candidates() -> SmallVec<[PathBuf; 2]> {
|
|||
return sysroot_candidates;
|
||||
}
|
||||
|
||||
/// Returns the provided sysroot or calls [`get_or_default_sysroot`] if it's none.
|
||||
/// Panics if [`get_or_default_sysroot`] returns an error.
|
||||
pub fn materialize_sysroot(maybe_sysroot: Option<PathBuf>) -> PathBuf {
|
||||
maybe_sysroot.unwrap_or_else(|| get_or_default_sysroot().expect("Failed finding sysroot"))
|
||||
}
|
||||
|
||||
/// This function checks if sysroot is found using env::args().next(), and if it
|
||||
/// is not found, finds sysroot from current rustc_driver dll.
|
||||
pub fn get_or_default_sysroot() -> Result<PathBuf, String> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue