-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.rs
37 lines (34 loc) · 813 Bytes
/
build.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
fn main() {
// Temporary fix for warnings in rustc v1.84.0.
// TODO: remove after next gdext release.
println!("cargo::rustc-check-cfg=cfg(before_api, values(\"4.3\"))");
// This script is only needed for GDAL static builds.
if std::env::var("GDAL_STATIC").unwrap_or_default() != "1" {
return;
};
// Use the correct C++ standard library.
if std::env::var("CARGO_CFG_TARGET_OS").unwrap() == "android" {
println!("cargo::rustc-link-lib=c++");
} else {
println!("cargo::rustc-link-lib=stdc++");
}
// GDAL dependencies.
let libs = [
"crypto",
"curl",
"geotiff",
"geos",
"geos_c",
"json-c",
"lzma",
"proj",
"sqlite3",
"ssl",
"tiff",
"turbojpeg",
"z",
];
for lib in libs {
println!("cargo::rustc-link-lib={lib}");
}
}