Skip to content

Commit f125198

Browse files
authored
Fix build on macOS with latest cc crate (#67)
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 #66.
1 parent 6012eaa commit f125198

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/lib.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,13 +240,18 @@ impl Build {
240240
continue;
241241
}
242242

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

253+
// cargo-lipo specifies this but OpenSSL complains
254+
if target.contains("apple-ios") {
250255
if arg == "-isysroot" {
251256
is_isysroot = true;
252257
continue;

0 commit comments

Comments
 (0)