From 2ec8d46dd1b6adc116a5efba46b7aad4a5315f86 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Fri, 24 Nov 2023 23:54:18 +0100 Subject: [PATCH] Correctly handle `OVERWRITE_TARGET_TRIPLE` env variable --- build_system/src/config.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/build_system/src/config.rs b/build_system/src/config.rs index 267f45464423..d602cec9f9f5 100644 --- a/build_system/src/config.rs +++ b/build_system/src/config.rs @@ -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(); }