Fix build on macOS

This commit is contained in:
Pekka Enberg
2023-09-09 12:42:22 +03:00
parent 60abb68cef
commit caf56bdc77
2 changed files with 7 additions and 4 deletions

View File

@@ -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"

View File

@@ -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 })