From 6b004c5ac6a25f1020774276803b62e8619ea61e Mon Sep 17 00:00:00 2001 From: omniscient <17525998+omnisci3nce@users.noreply.github.com> Date: Sat, 27 Jul 2024 23:19:15 +1000 Subject: env var for static lib --- bindgen/rust/celeritas-sys/build.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'bindgen/rust') diff --git a/bindgen/rust/celeritas-sys/build.rs b/bindgen/rust/celeritas-sys/build.rs index e2c240b..13aa04d 100644 --- a/bindgen/rust/celeritas-sys/build.rs +++ b/bindgen/rust/celeritas-sys/build.rs @@ -31,8 +31,12 @@ fn main() { // Tell cargo to look for shared libraries in the specified directory // TODO: we need to look based on OS - println!("cargo:rustc-link-search=../../../build/macosx/arm64/debug"); // println!("cargo:rustc-link-search=../../build/windows/x64/debug"); + + let static_lib_path = std::env::var("CELERITAS_CORE_LIB") + .unwrap_or("../../../build/macosx/arm64/debug".to_string()); + + println!("cargo:rustc-link-search={static_lib_path}"); // Tell cargo to tell rustc to link the system bzip2 // shared library. -- cgit v1.2.3-70-g09d2