Add feature flag to include wasm32-wasi-vfs.c

This commit is contained in:
Tjeu Kayim 2020-07-20 20:04:55 +02:00 committed by Thom Chiovoloni
parent 1483f1cdf5
commit 464b8283b2
3 changed files with 6 additions and 2 deletions

View File

@ -60,6 +60,7 @@ bundled-windows = ["libsqlite3-sys/bundled-windows"]
# Build bundled sqlite with -fsanitize=address
with-asan = ["libsqlite3-sys/with-asan"]
column_decltype = []
wasm32-wasi-vfs = ["libsqlite3-sys/wasm32-wasi-vfs"]
# Helper feature for enabling both `bundled` and most non-build-related optional
# features or dependencies. This is useful for running tests / clippy / etc. New

View File

@ -32,6 +32,7 @@ preupdate_hook = ["buildtime_bindgen"]
session = ["preupdate_hook", "buildtime_bindgen"]
in_gecko = []
with-asan = []
wasm32-wasi-vfs = []
[build-dependencies]
bindgen = { version = "0.54", optional = true, default-features = false, features = ["runtime"] }

View File

@ -111,10 +111,12 @@ mod build_bundled {
}
// 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")
cfg.flag("-DSQLITE_OS_OTHER")
// https://github.com/rust-lang/rust/issues/74393
.flag("-DLONGDOUBLE_TYPE=double");
if cfg!(feature = "wasm32-wasi-vfs") {
cfg.file("sqlite3/wasm32-wasi-vfs.c");
}
}
if cfg!(feature = "unlock_notify") {
cfg.flag("-DSQLITE_ENABLE_UNLOCK_NOTIFY");