Skip to content

Commit 44a5038

Browse files
committed
Do not enforce building libsqlite3 from source
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.
1 parent 9a6b47d commit 44a5038

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

proj-sys/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ links = "proj"
1212
rust-version = "1.70"
1313

1414
[dependencies]
15-
libsqlite3-sys = { version = "0.28", features = ["bundled"] }
15+
libsqlite3-sys = "0.28"
1616
link-cplusplus = "1.0"
1717

1818
[build-dependencies]

proj-sys/build.rs

+6-8
Original file line numberDiff line numberDiff line change
@@ -98,14 +98,12 @@ fn build_from_source() -> Result<std::path::PathBuf, Box<dyn std::error::Error>>
9898
config.define("BUILD_PROJINFO", "OFF");
9999
config.define("BUILD_PROJSYNC", "OFF");
100100
config.define("ENABLE_CURL", "OFF");
101-
config.define(
102-
"SQLITE3_INCLUDE_DIR",
103-
std::env::var("DEP_SQLITE3_INCLUDE").expect("This is set by libsqlite3-sys"),
104-
);
105-
config.define(
106-
"SQLITE3_LIBRARY",
107-
format!("{}/libsqlite3.a", std::env::var("DEP_SQLITE3_LIB_DIR").unwrap()),
108-
);
101+
if let Ok(sqlite_include) = std::env::var("DEP_SQLITE3_INCLUDE") {
102+
config.define("SQLITE3_INCLUDE_DIR", sqlite_include);
103+
}
104+
if let Ok(sqlite_lib_dir) = std::env::var("DEP_SQLITE3_LIB_DIR") {
105+
config.define("SQLITE3_LIBRARY", format!("{sqlite_lib_dir}/libsqlite3.a",));
106+
}
109107

110108
if cfg!(feature = "tiff") {
111109
eprintln!("enabling tiff support");

0 commit comments

Comments
 (0)