Skip to content

Commit 7600799

Browse files
authored
Avoid checking for overly-broad "cl" substring (#578)
Microsoft’s compiler is apparently called "-cl" on Linux and "cl.exe" on Windows. This allows for instance powerpcle to be used in the triple, and avoid considering it’s running under a MSVC compiler. Fixes #574.
1 parent 9900373 commit 7600799

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/lib.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2645,11 +2645,7 @@ impl Tool {
26452645
let family = if let Some(fname) = path.file_name().and_then(|p| p.to_str()) {
26462646
if fname.contains("clang-cl") {
26472647
ToolFamily::Msvc { clang_cl: true }
2648-
} else if fname.contains("cl")
2649-
&& !fname.contains("cloudabi")
2650-
&& !fname.contains("uclibc")
2651-
&& !fname.contains("clang")
2652-
{
2648+
} else if fname.ends_with("cl") || fname == "cl.exe" {
26532649
ToolFamily::Msvc { clang_cl: false }
26542650
} else if fname.contains("clang") {
26552651
match clang_driver {

0 commit comments

Comments
 (0)