From c4d7f1d29f05e9655e3827529ba4da3438e3e1fb Mon Sep 17 00:00:00 2001 From: onur-ozkan Date: Sun, 8 Dec 2024 18:27:22 +0300 Subject: implement `TargetSelection::is_cygwin` function Signed-off-by: onur-ozkan --- src/bootstrap/src/core/config/config.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/bootstrap') diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs index b06147055f2..a07d1597746 100644 --- a/src/bootstrap/src/core/config/config.rs +++ b/src/bootstrap/src/core/config/config.rs @@ -565,6 +565,12 @@ impl TargetSelection { self.ends_with("windows-gnu") } + pub fn is_cygwin(&self) -> bool { + self.is_windows() && + // ref. https://cygwin.com/pipermail/cygwin/2022-February/250802.html + env::var("OSTYPE").is_ok_and(|v| v.to_lowercase().contains("cygwin")) + } + /// Path to the file defining the custom target, if any. pub fn filepath(&self) -> Option<&Path> { self.file.as_ref().map(Path::new) -- cgit 1.4.1-3-g733a5