Skip to content

Commit

Permalink
Set default compiler to clang on apple hosts
Browse files Browse the repository at this point in the history
  • Loading branch information
spl committed May 30, 2019
1 parent b43413f commit 615c53b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1426,8 +1426,6 @@ impl Build {
}

if target.contains("-ios") {
// FIXME: potential bug. iOS is always compiled with Clang, but Gcc compiler may be
// detected instead.
self.ios_flags(cmd)?;
}

Expand Down Expand Up @@ -1682,9 +1680,12 @@ impl Build {
("CC", "cl.exe", "gcc", "cc", "clang")
};

// On Solaris, c++/cc unlikely to exist or be correct.
let default = if host.contains("solaris") {
// On Solaris, cc/c++ is unlikely to exist or be correct.
gnu
} else if host.contains("apple") {
// On macOS, this allows us to correctly identify the ToolFamily.
clang
} else {
traditional
};
Expand Down

0 comments on commit 615c53b

Please sign in to comment.