Added feature to build a static sqlite from the bundled amalgamation.

This commit is contained in:
Chip Collier
2016-06-15 16:34:13 +02:00
parent a9421e2047
commit dde6e9ee3a
3 changed files with 18 additions and 6 deletions

View File

@@ -1,9 +1,11 @@
extern crate gcc;
extern crate pkg_config;
use std::env;
use std::fs;
#[cfg(not(feature = "bundled"))]
fn main() {
use std::env;
use std::fs;
// Allow users to specify where to find SQLite.
let lib_dir = match env::var("SQLITE3_LIB_DIR") {
Ok(dir) => dir,
@@ -24,3 +26,8 @@ fn main() {
println!("cargo:rustc-link-lib=sqlite3");
println!("cargo:rustc-link-search={}", lib_dir);
}
#[cfg(feature = "bundled")]
fn main() {
gcc::compile_library("libsqlite3.a", &["sqlite3/sqlite3.c"]);
}