detect-targets: Add support of MacOS universal binary (#552)

* Add support for MacOS universal bin
* Refactor: Extract new fn `macos::detect_alternative_targets`

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
Jiahao XU 2022-11-21 20:16:28 +11:00 committed by GitHub
parent 26b28dc63f
commit 62e350eba9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 8 deletions

View file

@ -42,9 +42,7 @@ pub async fn detect_targets() -> Vec<String> {
v.push(v[0].replace("gnu", "musl"));
}
} else if #[cfg(target_os = "macos")] {
if &*v[0] == macos::AARCH64 {
v.push(macos::X86.into());
}
v.extend(macos::detect_alternative_targets(&v[0]));
} else if #[cfg(target_os = "windows")] {
v.extend(windows::detect_alternative_targets(&v[0]));
}