Skip to content

Commit 425c2a1

Browse files
committed
Implement current_system constructor for toolchain enum
1 parent 0fd7681 commit 425c2a1

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

lib/descriptor/toolchain.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,15 @@ impl Toolchain {
2222
*/
2323
#[must_use]
2424
pub const fn current_system() -> Option<Self> {
25-
None // TODO: Implement detection of the host toolchain
25+
if cfg!(target_env = "msvc") {
26+
Some(Self::Msvc)
27+
} else if cfg!(target_env = "gnu") {
28+
Some(Self::Gnu)
29+
} else if cfg!(target_env = "musl") {
30+
Some(Self::Musl)
31+
} else {
32+
None
33+
}
2634
}
2735

2836
/**

0 commit comments

Comments
 (0)