From 50e3259fe622b0c08d11be864bbf6310e639b651 Mon Sep 17 00:00:00 2001 From: Nikhil Benesch Date: Wed, 8 Jul 2020 13:11:47 -0400 Subject: [PATCH] Fix build on macOS with latest cc crate 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. --- src/lib.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 49391f45..6310c038 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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;