Skip to content

Commit c4d7f1d

Browse files
committed
implement TargetSelection::is_cygwin function
Signed-off-by: onur-ozkan <[email protected]>
1 parent ae3703c commit c4d7f1d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/bootstrap/src/core/config/config.rs

+6
Original file line numberDiff line numberDiff line change
@@ -565,6 +565,12 @@ impl TargetSelection {
565565
self.ends_with("windows-gnu")
566566
}
567567

568+
pub fn is_cygwin(&self) -> bool {
569+
self.is_windows() &&
570+
// ref. https://cygwin.com/pipermail/cygwin/2022-February/250802.html
571+
env::var("OSTYPE").is_ok_and(|v| v.to_lowercase().contains("cygwin"))
572+
}
573+
568574
/// Path to the file defining the custom target, if any.
569575
pub fn filepath(&self) -> Option<&Path> {
570576
self.file.as_ref().map(Path::new)

0 commit comments

Comments
 (0)