mirror of
https://github.com/isar/rusqlite.git
synced 2025-03-31 19:12:58 +08:00
commit
cd6a6f4b36
@ -131,12 +131,12 @@ mod build_bundled {
|
||||
.flag("-DSQLITE_ENABLE_LOAD_EXTENSION=1")
|
||||
.flag("-DSQLITE_ENABLE_MEMORY_MANAGEMENT")
|
||||
.flag("-DSQLITE_ENABLE_RTREE")
|
||||
.flag("-DSQLITE_ENABLE_STAT2")
|
||||
.flag("-DSQLITE_ENABLE_STAT4")
|
||||
.flag("-DSQLITE_SOUNDEX")
|
||||
.flag("-DSQLITE_THREADSAFE=1")
|
||||
.flag("-DSQLITE_USE_URI")
|
||||
.flag("-DHAVE_USLEEP=1")
|
||||
.flag("-DHAVE_ISNAN")
|
||||
.flag("-D_POSIX_THREAD_SAFE_FUNCTIONS") // cross compile with MinGW
|
||||
.warnings(false);
|
||||
|
||||
@ -236,25 +236,6 @@ mod build_bundled {
|
||||
cfg.static_crt(true);
|
||||
}
|
||||
|
||||
// Older versions of visual studio don't support c99 (including isnan), which
|
||||
// causes a build failure when the linker fails to find the `isnan`
|
||||
// function. `sqlite` provides its own implementation, using the fact
|
||||
// that x != x when x is NaN.
|
||||
//
|
||||
// There may be other platforms that don't support `isnan`, they should be
|
||||
// tested for here.
|
||||
if is_compiler("msvc") {
|
||||
use cc::windows_registry::{find_vs_version, VsVers};
|
||||
let vs_has_nan = match find_vs_version() {
|
||||
Ok(ver) => ver != VsVers::Vs12,
|
||||
Err(_msg) => false,
|
||||
};
|
||||
if vs_has_nan {
|
||||
cfg.flag("-DHAVE_ISNAN");
|
||||
}
|
||||
} else {
|
||||
cfg.flag("-DHAVE_ISNAN");
|
||||
}
|
||||
if !win_target() {
|
||||
cfg.flag("-DHAVE_LOCALTIME_R");
|
||||
}
|
||||
@ -283,17 +264,17 @@ mod build_bundled {
|
||||
}
|
||||
|
||||
if let Ok(limit) = env::var("SQLITE_MAX_VARIABLE_NUMBER") {
|
||||
cfg.flag(&format!("-DSQLITE_MAX_VARIABLE_NUMBER={limit}"));
|
||||
cfg.flag(format!("-DSQLITE_MAX_VARIABLE_NUMBER={limit}"));
|
||||
}
|
||||
println!("cargo:rerun-if-env-changed=SQLITE_MAX_VARIABLE_NUMBER");
|
||||
|
||||
if let Ok(limit) = env::var("SQLITE_MAX_EXPR_DEPTH") {
|
||||
cfg.flag(&format!("-DSQLITE_MAX_EXPR_DEPTH={limit}"));
|
||||
cfg.flag(format!("-DSQLITE_MAX_EXPR_DEPTH={limit}"));
|
||||
}
|
||||
println!("cargo:rerun-if-env-changed=SQLITE_MAX_EXPR_DEPTH");
|
||||
|
||||
if let Ok(limit) = env::var("SQLITE_MAX_COLUMN") {
|
||||
cfg.flag(&format!("-DSQLITE_MAX_COLUMN={limit}"));
|
||||
cfg.flag(format!("-DSQLITE_MAX_COLUMN={limit}"));
|
||||
}
|
||||
println!("cargo:rerun-if-env-changed=SQLITE_MAX_COLUMN");
|
||||
|
||||
@ -302,7 +283,7 @@ mod build_bundled {
|
||||
if extra.starts_with("-D") || extra.starts_with("-U") {
|
||||
cfg.flag(extra);
|
||||
} else if extra.starts_with("SQLITE_") {
|
||||
cfg.flag(&format!("-D{extra}"));
|
||||
cfg.flag(format!("-D{extra}"));
|
||||
} else {
|
||||
panic!("Don't understand {} in LIBSQLITE3_FLAGS", extra);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user