mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-04-22 05:28:42 +00:00
Merge pull request #193 from NobodyXu/fix/macos-target-detection
Fix macos detection: Use built-time `TARGET` as fallback
This commit is contained in:
commit
9d70e33337
1 changed files with 7 additions and 4 deletions
|
@ -199,17 +199,20 @@ mod linux {
|
|||
|
||||
#[cfg(target_os = "macos")]
|
||||
mod macos {
|
||||
use super::TARGET;
|
||||
use guess_host_triple::guess_host_triple;
|
||||
|
||||
pub(super) const AARCH64: &str = "aarch64-apple-darwin";
|
||||
pub(super) const X86: &str = "x86_64-apple-darwin";
|
||||
|
||||
pub(super) fn detect_targets_macos() -> Vec<String> {
|
||||
if guess_host_triple() == Some(AARCH64) {
|
||||
vec![AARCH64.into(), X86.into()]
|
||||
} else {
|
||||
vec![X86.into()]
|
||||
let mut targets = vec![guess_host_triple().unwrap_or(TARGET).to_string()];
|
||||
|
||||
if targets[0] == AARCH64 {
|
||||
targets.push(X86.into());
|
||||
}
|
||||
|
||||
targets
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue