From 91a33c65f3bdc82bef4cbe95f614e1f533e5b368 Mon Sep 17 00:00:00 2001 From: Kayla Washburn Date: Thu, 14 Jul 2022 16:01:07 -0600 Subject: [PATCH] fix(ext/ffi): allow setting a custom lib path for libtcc.a (#15208) --- ext/ffi/build.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ext/ffi/build.rs b/ext/ffi/build.rs index fd6aea6089e2fa..091dd95994368b 100644 --- a/ext/ffi/build.rs +++ b/ext/ffi/build.rs @@ -58,6 +58,10 @@ fn main() {} #[cfg(not(target_os = "windows"))] fn main() { - build_tcc(); + if let Ok(tcc_path) = env::var("TCC_PATH") { + println!("cargo:rustc-link-search=native={}", tcc_path); + } else { + build_tcc(); + } println!("cargo:rustc-link-lib=static=tcc"); }