call: Fix crash when screensharing on MacOS (#28784)

Piotr Osiewicz , Conrad , and Anthony Eid created

Closes #ISSUE

Release Notes:

- Fixed a crash when screensharing on MacOS

Co-authored-by: Conrad <conrad@zed.dev>
Co-authored-by: Anthony Eid <hello@anthonyeid.me>

Change summary

crates/gpui/build.rs | 2 --
crates/zed/build.rs  | 3 +++
2 files changed, 3 insertions(+), 2 deletions(-)

Detailed changes

crates/gpui/build.rs 🔗

@@ -77,8 +77,6 @@ mod macos {
 
     fn generate_dispatch_bindings() {
         println!("cargo:rustc-link-lib=framework=System");
-        // weak link to support Catalina
-        println!("cargo:rustc-link-arg=-Wl,-weak_framework,ScreenCaptureKit");
 
         let bindings = bindgen::Builder::default()
             .header("src/platform/mac/dispatch.h")

crates/zed/build.rs 🔗

@@ -12,6 +12,9 @@ fn main() {
 
         // Register exported Objective-C selectors, protocols, etc
         println!("cargo:rustc-link-arg=-Wl,-ObjC");
+
+        // weak link to support Catalina
+        println!("cargo:rustc-link-arg=-Wl,-weak_framework,ScreenCaptureKit");
     }
 
     // Populate git sha environment variable if git is available