Skip to content

Commit

Permalink
Try #92:
Browse files Browse the repository at this point in the history
  • Loading branch information
bors[bot] authored Oct 20, 2021
2 parents 801f653 + 1af8efe commit ce2a8d9
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@ members = ["proj-sys"]
[features]
default = ["geo-types"]
bundled_proj = [ "proj-sys/bundled_proj" ]
bundled_proj_tiff = [ "proj-sys/bundled_proj_tiff" ]
pkg_config = [ "proj-sys/pkg_config" ]
network = ["bundled_proj_tiff", "reqwest"]
network = ["reqwest"]

[dev-dependencies]
approx = "0.3"
Expand Down
8 changes: 8 additions & 0 deletions proj-sys/CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# UNRELEASED

- BREAKING: Remove `bundled_proj_tiff` feature and assume system libproj has
the default enabled tiff support. Otherwise, the current setup would
unnecessarily build libproj from source in some cases, e.g. the geo crate's
proj network integration would compile libproj from source.
- <https://github.com/georust/proj/pull/92>

# 0.20.1
- Fix docs to refer to correct libproj version

Expand Down
1 change: 0 additions & 1 deletion proj-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ nobuild = []
bundled_proj = []
# `pkg_config` feature is deprecated and does nothing
pkg_config = []
bundled_proj_tiff = ["bundled_proj"]

[package.metadata.docs.rs]
features = [ "nobuild" ] # This feature will be enabled during the docs.rs build
12 changes: 4 additions & 8 deletions proj-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,17 +95,15 @@ fn build_from_source() -> Result<std::path::PathBuf, Box<dyn std::error::Error>>
config.define("BUILD_PROJINFO", "OFF");
config.define("BUILD_PROJSYNC", "OFF");
config.define("ENABLE_CURL", "OFF");
let tiff_support = cfg!(feature = "bundled_proj_tiff");
config.define("ENABLE_TIFF", if tiff_support { "ON" } else { "OFF" });
let proj = config.build();
// Tell cargo to tell rustc to link libproj, and where to find it
// libproj will be built in $OUT_DIR/lib

//proj likes to create proj_d when configured as debug and on MSVC, so link to that one if it exists
if proj.join("lib").join("proj_d.lib").exists() {
println!("cargo:rustc-link-lib=static=proj_d");
println!("cargo:rustc-link-lib=static=proj_d");
} else {
println!("cargo:rustc-link-lib=static=proj");
println!("cargo:rustc-link-lib=static=proj");
}
println!(
"cargo:rustc-link-search=native={}",
Expand All @@ -121,9 +119,7 @@ fn build_from_source() -> Result<std::path::PathBuf, Box<dyn std::error::Error>>
);
// The PROJ library needs SQLite and the C++ standard library.
println!("cargo:rustc-link-lib=dylib=sqlite3");
if tiff_support {
println!("cargo:rustc-link-lib=dylib=tiff");
}
println!("cargo:rustc-link-lib=dylib=tiff");
if cfg!(target_os = "linux") {
println!("cargo:rustc-link-lib=dylib=stdc++");
} else if cfg!(target_os = "macos") {
Expand Down

0 comments on commit ce2a8d9

Please sign in to comment.