diff --git a/src/target.rs b/src/target.rs index 4c6f8f57..24b0e3e9 100644 --- a/src/target.rs +++ b/src/target.rs @@ -19,8 +19,10 @@ pub async fn detect_targets() -> Vec> { { return linux::detect_targets_linux().await; } - - todo!() + #[cfg(target_os = "macos")] + { + macos::detect_targets_macos() + } } #[cfg(target_os = "linux")] @@ -95,3 +97,19 @@ mod linux { target.into_boxed_str() } } + +#[cfg(target_os = "macos")] +mod macos { + use guess_host_triple::guess_host_triple; + + const AARCH64: &str = "aarch64-apple-darwin"; + const X86: &str = "x86_64-apple-darwin"; + + pub(super) fn detect_targets_macos() -> Vec> { + if guess_host_triple() == Some(AARCH64) { + vec![AARCH64.into(), X86.into()] + } else { + vec![X86.into()] + } + } +}