diff --git a/src/lib.rs b/src/lib.rs index 9e76c7e60..196e5ab07 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1465,6 +1465,16 @@ impl Build { cmd.args.push("-m64".into()); } + if target.contains("darwin") { + if target.contains("x86_64") { + cmd.args.push("-arch".into()); + cmd.args.push("x86_64".into()); + } else if target.contains("aarch64") { + cmd.args.push("-arch".into()); + cmd.args.push("arm64".into()); + } + } + if self.static_flag.is_none() { let features = self .getenv("CARGO_CFG_TARGET_FEATURE")