fix: avoid ScreenCaptureKit launch crash on macOS 11 (#424)

Co-authored-by: txhno <[email protected]>
This commit is contained in:
Roshan Warrier
2026-04-16 01:58:29 -07:00
committed by GitHub
co-authored by txhno
parent 7184a25e44
commit a5d5c780c2
6 changed files with 47 additions and 18 deletions
+4
View File
@@ -5,6 +5,10 @@ fn main() {
// Link Swift runtime libraries for screencapturekit crate
#[cfg(target_os = "macos")]
{
// ScreenCaptureKit does not exist on macOS 11, so weak-link it to
// allow the app to launch and gate usage at runtime instead.
println!("cargo:rustc-link-arg=-Wl,-weak_framework,ScreenCaptureKit");
// Add Swift runtime library paths to RPATH
println!("cargo:rustc-link-arg=-Wl,-rpath,/usr/lib/swift");
println!("cargo:rustc-link-arg=-L/usr/lib/swift");