From b33f076971ea5cb86720fa2525b5d6839fef0fa7 Mon Sep 17 00:00:00 2001 From: Can Celik Date: Sun, 5 Apr 2026 17:19:27 +0300 Subject: [PATCH] build: statically link vendored libghostty-vt on macos --- build.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/build.rs b/build.rs index a421c5c5..5006f017 100644 --- a/build.rs +++ b/build.rs @@ -43,10 +43,14 @@ fn main() { let lib_dir = vendored_dir.join("zig-out/lib"); println!("cargo:rustc-link-search=native={}", lib_dir.display()); - println!("cargo:rustc-link-lib=static=ghostty-vt"); - if target.contains("linux") { - println!("cargo:rustc-link-lib=dylib=stdc++"); - } else if target.contains("apple-darwin") { + if target.contains("apple-darwin") { + let static_lib = lib_dir.join("libghostty-vt.a"); + println!("cargo:rustc-link-arg={}", static_lib.display()); println!("cargo:rustc-link-lib=dylib=c++"); + } else { + println!("cargo:rustc-link-lib=static=ghostty-vt"); + if target.contains("linux") { + println!("cargo:rustc-link-lib=dylib=stdc++"); + } } }