Correctly handle OVERWRITE_TARGET_TRIPLE env variable

This commit is contained in:
Guillaume Gomez 2023-11-24 23:54:18 +01:00
parent 53b2759bef
commit 2ec8d46dd1

View File

@ -78,6 +78,11 @@ impl ConfigInfo {
};
self.host_triple = rustc_version_info(Some(&rustc))?.host.unwrap_or_default();
if self.target_triple.is_empty() {
if let Some(overwrite) = env.get("OVERWRITE_TARGET_TRIPLE") {
self.target_triple = overwrite.clone();
}
}
if self.target_triple.is_empty() {
self.target_triple = self.host_triple.clone();
}