Skip to content

Commit

Permalink
Do not enforce building libsqlite3 from source
Browse files Browse the repository at this point in the history
Instead we now just check if it was build from source (by checking the
relevant environment variables) and if that was the case we link that
version statically.
  • Loading branch information
weiznich committed Feb 26, 2024
1 parent 9a6b47d commit 44a5038
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion proj-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ links = "proj"
rust-version = "1.70"

[dependencies]
libsqlite3-sys = { version = "0.28", features = ["bundled"] }
libsqlite3-sys = "0.28"
link-cplusplus = "1.0"

[build-dependencies]
Expand Down
14 changes: 6 additions & 8 deletions proj-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,12 @@ 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");
config.define(
"SQLITE3_INCLUDE_DIR",
std::env::var("DEP_SQLITE3_INCLUDE").expect("This is set by libsqlite3-sys"),
);
config.define(
"SQLITE3_LIBRARY",
format!("{}/libsqlite3.a", std::env::var("DEP_SQLITE3_LIB_DIR").unwrap()),
);
if let Ok(sqlite_include) = std::env::var("DEP_SQLITE3_INCLUDE") {
config.define("SQLITE3_INCLUDE_DIR", sqlite_include);
}
if let Ok(sqlite_lib_dir) = std::env::var("DEP_SQLITE3_LIB_DIR") {
config.define("SQLITE3_LIBRARY", format!("{sqlite_lib_dir}/libsqlite3.a",));
}

if cfg!(feature = "tiff") {
eprintln!("enabling tiff support");
Expand Down

0 comments on commit 44a5038

Please sign in to comment.