Skip to content

Commit 20b6012

Browse files
committed
Whitelist features (versions) emitted by netcdf-sys
1 parent 023a58a commit 20b6012

File tree

3 files changed

+33
-0
lines changed

3 files changed

+33
-0
lines changed

netcdf-sys/build.rs

+2
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,8 @@ fn main() {
294294
Version::new(4, 9, 0),
295295
Version::new(4, 9, 1),
296296
Version::new(4, 9, 2),
297+
Version::new(4, 9, 3),
298+
// Keep this list up to date with netcdf/build.rs
297299
];
298300

299301
for version in &versions {

netcdf/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ mpi-sys = { workspace = true, optional = true }
3535
clap = { version = "4.5.1", features = ["derive"] }
3636
tempfile = "3.1.0"
3737

38+
[build-dependencies]
39+
semver = "1.0.23"
40+
3841
[package.metadata.docs.rs]
3942
features = ["static"]
4043
rustdoc-args = ["--cfg", "docsrs"]

netcdf/build.rs

+28
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,33 @@
1+
use semver::Version;
2+
13
fn main() {
24
println!("cargo::rustc-check-cfg=cfg(feature, values(\"has-mmap\"))");
5+
let versions = [
6+
Version::new(4, 4, 0),
7+
Version::new(4, 4, 1),
8+
Version::new(4, 5, 0),
9+
Version::new(4, 6, 0),
10+
Version::new(4, 6, 1),
11+
Version::new(4, 6, 2),
12+
Version::new(4, 6, 3),
13+
Version::new(4, 7, 0),
14+
Version::new(4, 7, 1),
15+
Version::new(4, 7, 2),
16+
Version::new(4, 7, 3),
17+
Version::new(4, 7, 4),
18+
Version::new(4, 8, 0),
19+
Version::new(4, 8, 1),
20+
Version::new(4, 9, 0),
21+
Version::new(4, 9, 1),
22+
Version::new(4, 9, 2),
23+
Version::new(4, 9, 3),
24+
// Keep this list up to date with netcdf-sys/build.rs
25+
];
26+
27+
for version in &versions {
28+
println!("cargo::rustc-check-cfg=cfg(feature, values(\"{version}\"))");
29+
}
30+
331
if std::env::var("DEP_NETCDF_HAS_MMAP").is_ok() {
432
println!("cargo::rustc-cfg=feature=\"has-mmap\"");
533
}

0 commit comments

Comments
 (0)