diff --git a/hdf5-src/src/lib.rs b/hdf5-src/src/lib.rs index e39a2b152..174659f55 100644 --- a/hdf5-src/src/lib.rs +++ b/hdf5-src/src/lib.rs @@ -1 +1,4 @@ //! Dummy crate for building HDF5 C library from source. + +#[cfg(feature = "zlib")] +extern crate libz_sys; diff --git a/hdf5-sys/Cargo.toml b/hdf5-sys/Cargo.toml index 5fefdc1d1..4397ee6db 100644 --- a/hdf5-sys/Cargo.toml +++ b/hdf5-sys/Cargo.toml @@ -27,7 +27,7 @@ default = [] mpio = ["dep:mpi-sys"] hl = ["hdf5-src?/hl"] threadsafe = ["hdf5-src?/threadsafe"] -zlib = ["libz-sys", "hdf5-src?/zlib"] +zlib = ["dep:libz-sys", "hdf5-src?/zlib"] static = ["dep:hdf5-src"] deprecated = ["hdf5-src?/deprecated"] diff --git a/hdf5-sys/build.rs b/hdf5-sys/build.rs index b735f4605..5cb4238eb 100644 --- a/hdf5-sys/build.rs +++ b/hdf5-sys/build.rs @@ -734,9 +734,6 @@ fn get_build_and_emit() { if feature_enabled("ZLIB") { let zlib_lib = env::var("DEP_HDF5SRC_ZLIB").unwrap(); println!("cargo::metadata=zlib={}", &zlib_lib); - let zlib_lib_header = env::var("DEP_HDF5SRC_ZLIB").unwrap(); - println!("cargo::metadata=zlib={}", &zlib_lib_header); - println!("cargo::rustc-link-lib=static={}", &zlib_lib); } if feature_enabled("HL") { diff --git a/hdf5-sys/src/lib.rs b/hdf5-sys/src/lib.rs index f29df8cdd..867bb14c9 100644 --- a/hdf5-sys/src/lib.rs +++ b/hdf5-sys/src/lib.rs @@ -8,6 +8,13 @@ #![allow(clippy::module_name_repetitions)] #![cfg_attr(docsrs, feature(doc_cfg))] +#[cfg(feature = "static")] +extern crate hdf5_src; +#[cfg(feature = "zlib")] +extern crate libz_sys; +#[cfg(feature = "mpio")] +extern crate mpi_sys; + macro_rules! extern_static { ($dest:ident, $src:ident) => { extern "C" {