mirror of
https://github.com/isar/rusqlite.git
synced 2024-11-23 00:39:20 +08:00
sys/build.rs: LIBSQLITE3_FLAGS hook
Enables compiling bundled sources with different flags. Env variable name modeled after LIBSQLITE3_SYS_BUNDLING. May want to println!("cargo:warning=...") instead of panicking.
This commit is contained in:
parent
32df49ca34
commit
a9b700c841
@ -127,6 +127,19 @@ mod build_bundled {
|
|||||||
}
|
}
|
||||||
println!("cargo:rerun-if-env-changed=SQLITE_MAX_EXPR_DEPTH");
|
println!("cargo:rerun-if-env-changed=SQLITE_MAX_EXPR_DEPTH");
|
||||||
|
|
||||||
|
if let Ok(extras) = env::var("LIBSQLITE3_FLAGS") {
|
||||||
|
for extra in extras.split_whitespace() {
|
||||||
|
if extra.starts_with("-D") || extra.starts_with("-U") {
|
||||||
|
cfg.flag(extra);
|
||||||
|
} else if extra.starts_with("SQLITE_") {
|
||||||
|
cfg.flag(&format!("-D{}", extra));
|
||||||
|
} else {
|
||||||
|
panic!("Don't understand {} in LIBSQLITE3_FLAGS", extra);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
println!("cargo:rerun-if-env-changed=LIBSQLITE3_FLAGS");
|
||||||
|
|
||||||
cfg.compile("libsqlite3.a");
|
cfg.compile("libsqlite3.a");
|
||||||
|
|
||||||
println!("cargo:lib_dir={}", out_dir);
|
println!("cargo:lib_dir={}", out_dir);
|
||||||
|
Loading…
Reference in New Issue
Block a user