mirror of
https://github.com/isar/rusqlite.git
synced 2025-11-03 15:28:54 +08:00
Support wasm32-wasi target
This commit is contained in:
committed by
Thom Chiovoloni
parent
c00471197a
commit
1483f1cdf5
@@ -58,7 +58,8 @@ mod build_bundled {
|
||||
fs::copy("sqlite3/bindgen_bundled_version.rs", out_path)
|
||||
.expect("Could not copy bindings to output directory");
|
||||
}
|
||||
|
||||
println!("cargo:rerun-if-changed=sqlite3/sqlite3.c");
|
||||
println!("cargo:rerun-if-changed=sqlite3/wasm32-wasi-vfs.c");
|
||||
let mut cfg = cc::Build::new();
|
||||
cfg.file("sqlite3/sqlite3.c")
|
||||
.flag("-DSQLITE_CORE")
|
||||
@@ -108,6 +109,13 @@ mod build_bundled {
|
||||
if cfg!(not(target_os = "windows")) {
|
||||
cfg.flag("-DHAVE_LOCALTIME_R");
|
||||
}
|
||||
// Target wasm32-wasi can't compile the default VFS
|
||||
if env::var("TARGET") == Ok("wasm32-wasi".to_string()) {
|
||||
cfg.file("sqlite3/wasm32-wasi-vfs.c")
|
||||
.flag("-DSQLITE_OS_OTHER")
|
||||
// https://github.com/rust-lang/rust/issues/74393
|
||||
.flag("-DLONGDOUBLE_TYPE=double");
|
||||
}
|
||||
if cfg!(feature = "unlock_notify") {
|
||||
cfg.flag("-DSQLITE_ENABLE_UNLOCK_NOTIFY");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user