mirror of
https://github.com/aljazceru/turso.git
synced 2026-02-06 08:44:23 +01:00
Fix build on macOS
This commit is contained in:
@@ -17,11 +17,13 @@ path = "lib.rs"
|
||||
default = ["fs"]
|
||||
fs = []
|
||||
|
||||
[target.'cfg(target_os = "linux")'.dependencies]
|
||||
io-uring = "0.6.1"
|
||||
|
||||
[dependencies]
|
||||
anyhow = "1.0.75"
|
||||
concurrent_lru = "0.2.0"
|
||||
fallible-iterator = "0.3.0"
|
||||
io-uring = "0.6.1"
|
||||
log = "0.4.20"
|
||||
mimalloc = { version = "*", default-features = false }
|
||||
sqlite3-parser = "0.11.0"
|
||||
|
||||
@@ -4,10 +4,10 @@ use std::io::{Read, Seek};
|
||||
use std::os::unix::io::AsRawFd;
|
||||
use std::{fs::File, sync::Arc};
|
||||
|
||||
#[cfg(feature = "fs")]
|
||||
#[cfg(all(feature = "fs", target_os = "linux"))]
|
||||
mod io_uring;
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
#[cfg(feature = "fs")]
|
||||
mod syscall;
|
||||
|
||||
/// I/O access method
|
||||
@@ -35,7 +35,7 @@ impl Default for IO {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(all(feature = "fs", target_os = "darwin"))]
|
||||
#[cfg(all(feature = "fs", target_os = "macos"))]
|
||||
impl Default for IO {
|
||||
fn default() -> Self {
|
||||
IO {
|
||||
@@ -61,6 +61,7 @@ impl IO {
|
||||
let io = Arc::new(syscall::SyscallIO::open(path)?);
|
||||
Ok(PageSource { io })
|
||||
}
|
||||
#[cfg(all(feature = "fs", target_os = "darwin"))]
|
||||
IOMethod::IoUring => {
|
||||
let io = Arc::new(io_uring::IoUring::open(path)?);
|
||||
Ok(PageSource { io })
|
||||
|
||||
Reference in New Issue
Block a user