Skip to content

Commit

Permalink
Fix build on macOS with latest cc crate
Browse files Browse the repository at this point in the history
cc v1.0.58 broke the macOS build by including the "-arch" flag in the
default set of compiler flags. Strip it out, like we do for iOS targets.

Closes alexcrichton#66.
  • Loading branch information
benesch committed Jul 8, 2020
1 parent 6012eaa commit 50e3259
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,13 +240,18 @@ impl Build {
continue;
}

// cargo-lipo specifies this but OpenSSL complains
if target.contains("apple-ios") {
// cc includes an `-arch` flag for Apple platforms, but we've
// already selected an arch implicitly via the target above, and
// OpenSSL contains about the conflict if both are specified.
if target.contains("apple") {
if arg == "-arch" {
skip_next = true;
continue;
}
}

// cargo-lipo specifies this but OpenSSL complains
if target.contains("apple-ios") {
if arg == "-isysroot" {
is_isysroot = true;
continue;
Expand Down

0 comments on commit 50e3259

Please sign in to comment.