diff --git a/Cargo.toml b/Cargo.toml index dd8f575..a323f44 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -49,7 +49,7 @@ jsonwebtoken = "9.2.0" chrono = "0.4" # XCB is a PITA to compile for ARM so disabling the copy feature on ARM for now -[target.'cfg(target_arch = "x86_64")'.dependencies] +[target.'cfg(any(target_arch = "x86_64", all(target_os = "macos", target_arch = "aarch64")))'.dependencies] clipboard = "0.5" [dev-dependencies.cargo-husky] diff --git a/src/handlers/mod.rs b/src/handlers/mod.rs index f390a9d..03b73fe 100644 --- a/src/handlers/mod.rs +++ b/src/handlers/mod.rs @@ -274,7 +274,10 @@ fn handle_block_scroll(app: &mut App, up: bool, is_mouse: bool, page: bool) { } } -#[cfg(target_arch = "x86_64")] +#[cfg(any( + target_arch = "x86_64", + all(target_os = "macos", target_arch = "aarch64") +))] fn copy_to_clipboard(content: String) { use clipboard::{ClipboardContext, ClipboardProvider}; @@ -284,7 +287,10 @@ fn copy_to_clipboard(content: String) { .expect("Unable to set content to clipboard"); } -#[cfg(any(target_arch = "aarch64", target_arch = "arm"))] +#[cfg(not(any( + target_arch = "x86_64", + all(target_os = "macos", target_arch = "aarch64") +)))] fn copy_to_clipboard(_content: String) { // do nothing as its a PITA to compile for ARM with XCB and this feature is not that important }