diff --git a/npm/binary.js b/npm/binary.js index d66bf98..41b33d8 100644 --- a/npm/binary.js +++ b/npm/binary.js @@ -13,7 +13,7 @@ const getPlatform = () => { if (type === "Linux" && arch === "x64") { return "x86_64-unknown-linux-musl"; } - if (type === "Darwin" && arch === "x64") { + if (type === "Darwin" && (arch === "x64" || arch === "arm64")) { return "x86_64-apple-darwin"; } diff --git a/src/install/mod.rs b/src/install/mod.rs index 06bf72a..6474d1e 100644 --- a/src/install/mod.rs +++ b/src/install/mod.rs @@ -172,7 +172,7 @@ fn prebuilt_url(tool: &Tool, version: &str) -> Result { Tool::WasmOpt => "x86-linux", _ => bail!("Unrecognized target!"), } - } else if target::MACOS && target::x86_64 { + } else if target::MACOS && (target::x86_64 || target::aarch64) { "x86_64-apple-darwin" } else if target::WINDOWS && target::x86_64 { match tool { diff --git a/src/target.rs b/src/target.rs index cfaff6a..0a6d38f 100644 --- a/src/target.rs +++ b/src/target.rs @@ -13,3 +13,5 @@ pub const WINDOWS: bool = cfg!(target_os = "windows"); pub const x86_64: bool = cfg!(target_arch = "x86_64"); #[allow(non_upper_case_globals)] pub const x86: bool = cfg!(target_arch = "x86"); +#[allow(non_upper_case_globals)] +pub const aarch64: bool = cfg!(target_arch = "aarch64");