From e2911bbe0f903abbd990889fcc45ab63a5ae707f Mon Sep 17 00:00:00 2001 From: rusticorn Date: Mon, 10 Aug 2026 18:44:34 +0200 Subject: [PATCH] add tvos support libdispatch lives inside libSystem on every Apple OS, not just macOS and iOS, and no Apple SDK ships a standalone libdispatch to fall back to. Naming only those two sends tvOS, watchOS and visionOS down the second arm, where the link fails with `ld: library 'dispatch' not found`. --- src/ffi.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ffi.rs b/src/ffi.rs index 91dad6f..4b7ac71 100644 --- a/src/ffi.rs +++ b/src/ffi.rs @@ -25,9 +25,9 @@ pub type dispatch_time_t = u64; // dispatch_io_interval_flags_t pub type dispatch_queue_attr_t = *const dispatch_object_s; -#[cfg_attr(any(target_os = "macos", target_os = "ios"), +#[cfg_attr(target_vendor = "apple", link(name = "System", kind = "dylib"))] -#[cfg_attr(not(any(target_os = "macos", target_os = "ios")), +#[cfg_attr(not(target_vendor = "apple"), link(name = "dispatch", kind = "dylib"))] extern { static _dispatch_main_q: dispatch_object_s;