Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set default compiler to clang on apple hosts #407

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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