Skip to content

Commit

Permalink
Add wrapper for configuration set/get
Browse files Browse the repository at this point in the history
  • Loading branch information
mulimoen committed May 5, 2024
1 parent 6c7e005 commit 01039a2
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions netcdf-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,10 @@ fn main() {
"cargo:rustc-cfg=feature=\"{}.{}.{}\"",
version.major, version.minor, version.patch
);
println!(
"cargo:version_\"{}.{}.{}\"=1",
version.major, version.minor, version.patch
);
}
}
metaheader.emit_feature_flags();
Expand Down
1 change: 1 addition & 0 deletions netcdf/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ static = ["netcdf-sys/static"]
ndarray = { version = "0.15", optional = true }
netcdf-sys = { workspace = true }
bitflags = "2.4.2"
libc = "0.2.154"

[dev-dependencies]
clap = { version = "4.5.1", features = ["derive"] }
Expand Down
5 changes: 5 additions & 0 deletions netcdf/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,9 @@ fn main() {
if std::env::var("DEP_NETCDF_HAS_MMAP").is_ok() {
println!("cargo:rustc-cfg=feature=\"has-mmap\"");
}
for (env, _value) in std::env::vars() {
if let Some(version) = env.strip_prefix("DEP_NETCDF_VERSION_") {
println!("cargo:rustc-cfg=feature={version}");
}
}
}
2 changes: 2 additions & 0 deletions netcdf/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ pub(crate) mod error;
pub(crate) mod extent;
pub(crate) mod file;
pub(crate) mod group;
#[cfg(feature = "4.9.2")]
pub mod rc;
pub mod types;
pub(crate) mod variable;

Expand Down

0 comments on commit 01039a2

Please sign in to comment.