mirror of
https://github.com/isar/rusqlite.git
synced 2024-11-23 00:39:20 +08:00
Added feature to build a static sqlite from the bundled amalgamation.
This commit is contained in:
parent
a9421e2047
commit
dde6e9ee3a
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "rusqlite"
|
||||
version = "0.7.3"
|
||||
version = "0.7.4"
|
||||
authors = ["John Gallagher <jgallagher@bignerdranch.com>"]
|
||||
description = "Ergonomic wrapper for SQLite"
|
||||
repository = "https://github.com/jgallagher/rusqlite"
|
||||
@ -18,6 +18,7 @@ backup = []
|
||||
blob = []
|
||||
functions = []
|
||||
trace = []
|
||||
bundled = ["libsqlite3-sys/bundled"]
|
||||
|
||||
[dependencies]
|
||||
time = "~0.1.0"
|
||||
@ -34,7 +35,7 @@ regex = "~0.1.41"
|
||||
|
||||
[dependencies.libsqlite3-sys]
|
||||
path = "libsqlite3-sys"
|
||||
version = "0.5.0"
|
||||
version = "0.6.0"
|
||||
|
||||
[[test]]
|
||||
name = "config_log"
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "libsqlite3-sys"
|
||||
version = "0.5.0"
|
||||
version = "0.6.0"
|
||||
authors = ["John Gallagher <jgallagher@bignerdranch.com>"]
|
||||
repository = "https://github.com/jgallagher/rusqlite"
|
||||
description = "Native bindings to the libsqlite3 library"
|
||||
@ -8,8 +8,12 @@ license = "MIT"
|
||||
links = "sqlite3"
|
||||
build = "build.rs"
|
||||
|
||||
[features]
|
||||
bundled = []
|
||||
|
||||
[build-dependencies]
|
||||
pkg-config = "~0.3"
|
||||
gcc = "~0.3"
|
||||
|
||||
[dependencies]
|
||||
libc = "~0.2"
|
||||
|
@ -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"]);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user