Skip to content

Commit 615c53b

Browse files
committed
Set default compiler to clang on apple hosts
1 parent b43413f commit 615c53b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/lib.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1426,8 +1426,6 @@ impl Build {
14261426
}
14271427

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

@@ -1682,9 +1680,12 @@ impl Build {
16821680
("CC", "cl.exe", "gcc", "cc", "clang")
16831681
};
16841682

1685-
// On Solaris, c++/cc unlikely to exist or be correct.
16861683
let default = if host.contains("solaris") {
1684+
// On Solaris, cc/c++ is unlikely to exist or be correct.
16871685
gnu
1686+
} else if host.contains("apple") {
1687+
// On macOS, this allows us to correctly identify the ToolFamily.
1688+
clang
16881689
} else {
16891690
traditional
16901691
};

0 commit comments

Comments
 (0)