28 lines
997 B
Rust
28 lines
997 B
Rust
extern crate dotenv;
|
|
|
|
use std::env;
|
|
use std::path::PathBuf;
|
|
|
|
fn main() {
|
|
dotenv::from_filename(".env.build").ok();
|
|
|
|
let manifest_dir = env::var("CARGO_MANIFEST_DIR").unwrap();
|
|
|
|
let static_lib_path = PathBuf::from(manifest_dir).join("lib");
|
|
println!("cargo::rustc-link-search=native={}", static_lib_path.display());
|
|
println!("cargo::rustc-link-lib=static=p4pillondebuglib");
|
|
|
|
let fsv_lib_path = PathBuf::from(env::var("SESAM_FSV_LIB_PATH").unwrap());
|
|
println!("cargo::rustc-link-search=native={}", fsv_lib_path.display());
|
|
println!("cargo::rustc-link-lib=dylib={}", env::var("SESAM_FSV_SSVLIB").unwrap());
|
|
|
|
if cfg!(target_os = "windows") {
|
|
// Get PATH value
|
|
let path = env::var("PATH").unwrap_or(String::new());
|
|
println!("PATH={}", path);
|
|
println!("cargo:rustc-env=PATH={}", fsv_lib_path.display());
|
|
} else if cfg!(target_os = "linux") {
|
|
println!("cargo:rustc-env=LD_LIBRARY_PATH={}", fsv_lib_path.display());
|
|
}
|
|
}
|