Merge pull request #665 from thomcc/in-gecko

Add in_gecko feature to libsqlite3-sys to bypass linking / perform the (currently minor) changes needed to integrate
This commit is contained in:
gwenn 2020-04-04 07:46:57 +02:00 committed by GitHub
commit 6edf72857e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 0 deletions

View File

@ -57,6 +57,7 @@ series = ["vtab"]
extra_check = [] extra_check = []
modern_sqlite = ["libsqlite3-sys/bundled_bindings"] modern_sqlite = ["libsqlite3-sys/bundled_bindings"]
unstable = [] unstable = []
in_gecko = ["modern_sqlite", "libsqlite3-sys/in_gecko"]
[dependencies] [dependencies]
time = "0.1.0" time = "0.1.0"

View File

@ -30,6 +30,7 @@ unlock_notify = []
preupdate_hook = [] preupdate_hook = []
# 3.13.0 # 3.13.0
session = ["preupdate_hook"] session = ["preupdate_hook"]
in_gecko = []
[build-dependencies] [build-dependencies]
bindgen = { version = "0.53", optional = true, default-features = false, features = ["runtime"] } bindgen = { version = "0.53", optional = true, default-features = false, features = ["runtime"] }

View File

@ -4,6 +4,13 @@ use std::path::Path;
fn main() { fn main() {
let out_dir = env::var("OUT_DIR").unwrap(); let out_dir = env::var("OUT_DIR").unwrap();
let out_path = Path::new(&out_dir).join("bindgen.rs"); let out_path = Path::new(&out_dir).join("bindgen.rs");
if cfg!(feature = "in_gecko") {
// When inside mozilla-central, we are included into the build with
// sqlite3.o directly, so we don't want to provide any linker arguments.
std::fs::copy("sqlite3/bindgen_bundled_version.rs", out_path)
.expect("Could not copy bindings to output directory");
return;
}
if cfg!(feature = "sqlcipher") { if cfg!(feature = "sqlcipher") {
if cfg!(any( if cfg!(any(
feature = "bundled", feature = "bundled",