Skip to content

Commit 7427471

Browse files
committed
Add source options for multiple hdf5 version
1 parent 27a59c2 commit 7427471

File tree

6 files changed

+43
-16
lines changed

6 files changed

+43
-16
lines changed

.gitmodules

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1-
[submodule "hdf5"]
2-
path = hdf5-src/ext/hdf5
1+
[submodule "hdf5-src/ext/1_13_0"]
2+
path = hdf5-src/ext/1_13
3+
url = https://github.com/HDFGroup/hdf5.git
4+
[submodule "hdf5-src/ext/1_12_0"]
5+
path = hdf5-src/ext/1_12
6+
url = https://github.com/HDFGroup/hdf5.git
7+
[submodule "hdf5-src/ext/1_10_0"]
8+
path = hdf5-src/ext/1_10
39
url = https://github.com/HDFGroup/hdf5.git

hdf5-src/Cargo.toml

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "hdf5-src"
33
version = "0.8.1" # !V
44
authors = ["Ivan Smirnov <i.s.smirnov@gmail.com>"]
55
keywords = ["hdf5"]
6-
license-file = "ext/hdf5/COPYING"
6+
license-file = "ext/1_13/COPYING"
77
build = "build.rs"
88
repository = "https://github.com/aldanor/hdf5-rust"
99
homepage = "https://github.com/aldanor/hdf5-rust"
@@ -13,25 +13,36 @@ links = "hdf5src"
1313
readme = "README.md"
1414
categories = ["ffi"]
1515
exclude = [
16-
"ext/hdf5/bin/**",
17-
"ext/hdf5/c++/**",
18-
"ext/hdf5/examples/**",
19-
"ext/hdf5/fortran/**",
20-
"ext/hdf5/java/**",
21-
"ext/hdf5/release_docs/**",
22-
"ext/hdf5/test/**",
23-
"ext/hdf5/testpar/**",
24-
"ext/hdf5/tools/**",
25-
"ext/hdf5/hl/test/**",
26-
"ext/hdf5/hl/tools/**",
27-
"ext/hdf5/hl/examples/**",
16+
"ext/*/bin/**",
17+
"ext/*/c++/**",
18+
"ext/*/examples/**",
19+
"ext/*/fortran/**",
20+
"ext/*/java/**",
21+
"ext/*/release_docs/**",
22+
"ext/*/test/**",
23+
"ext/*/testpar/**",
24+
"ext/*/tools/**",
25+
"ext/*/m4/**",
26+
"ext/*/configure",
27+
"ext/*/MANIFEST",
28+
"ext/*/hl/test/**",
29+
"ext/*/hl/tools/**",
30+
"ext/*/hl/examples/**",
31+
"ext/*/hl/fortran/**",
32+
"ext/*/hl/c++/**",
33+
"ext/*/oxygen/**",
34+
"ext/*/doxygen/**",
35+
"ext/*/config/cmake_ext_mod/hdf.icns",
2836
]
2937

3038
[features]
3139
hl = []
3240
zlib = ["libz-sys"]
3341
deprecated = []
3442
threadsafe = []
43+
1_10 = []
44+
1_12 = []
45+
1_13 = []
3546

3647
[dependencies]
3748
libz-sys = { version = "1.0.25", features = ["static"], optional = true, default-features=false }

hdf5-src/build.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,15 @@ fn feature_enabled(feature: &str) -> bool {
66

77
fn main() {
88
println!("cargo:rerun-if-changed=build.rs");
9-
let mut cfg = cmake::Config::new("ext/hdf5");
9+
let mut cfg = if feature_enabled("1_13") {
10+
cmake::Config::new("ext/1_13")
11+
} else if feature_enabled("1_12") {
12+
cmake::Config::new("ext/1_12")
13+
} else if feature_enabled("1_10") {
14+
cmake::Config::new("ext/1_10")
15+
} else {
16+
cmake::Config::new("ext/1_10")
17+
};
1018

1119
// only build the static c library, disable everything else
1220
cfg.define("HDF5_NO_PACKAGES", "ON");
Submodule 1_10 updated from 0000000 to db30c2d

hdf5-src/ext/1_12

Submodule 1_12 added at 820695a

hdf5-src/ext/1_13

Submodule 1_13 added at 338c2c6

0 commit comments

Comments
 (0)