Skip to content

Commit

Permalink
Pass path to static library to netcdf-c
Browse files Browse the repository at this point in the history
  • Loading branch information
mulimoen committed May 8, 2024
1 parent 1b9b248 commit 0d16ffb
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions netcdf-src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,19 @@ fn main() {
println!("cargo:rerun-if-changed=build.rs");

let hdf5_incdir = std::env::var("DEP_HDF5_INCLUDE").unwrap();
let hdf5_lib = std::env::var("DEP_HDF5_LIBRARY").unwrap();
let hdf5_hl_lib = std::env::var("DEP_HDF5_HL_LIBRARY").unwrap();
let mut hdf5_lib = std::env::var("DEP_HDF5_LIBRARY").unwrap();
let mut hdf5_hl_lib = std::env::var("DEP_HDF5_HL_LIBRARY").unwrap();

#[cfg(unix)]
{
let hdf5_root = format!("{hdf5_incdir}/../");
let mut hdf5_libdir = format!("{hdf5_root}/lib/");
if !std::path::Path::new(&hdf5_libdir).exists() {
hdf5_libdir = format!("{hdf5_root}/lib64/");
}
hdf5_lib = format!("{hdf5_libdir}/{hdf5_lib}.a");
hdf5_hl_lib = format!("{hdf5_libdir}/{hdf5_hl_lib}.a");
}

let hdf5_version = get_hdf5_version();

Expand Down

0 comments on commit 0d16ffb

Please sign in to comment.