Add in_gecko feature to libsqlite3-sys to bypass linking.

This commit is contained in:
Thom Chiovoloni
2020-04-02 09:12:36 -07:00
parent 3ae52545a9
commit a2db66ee3e
3 changed files with 9 additions and 0 deletions

View File

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

View File

@@ -4,6 +4,13 @@ use std::path::Path;
fn main() {
let out_dir = env::var("OUT_DIR").unwrap();
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!(any(
feature = "bundled",