From 41e9f9aa6d7b9a00c5398377527a8ea48abf3a1c Mon Sep 17 00:00:00 2001 From: Michal Trybus Date: Fri, 19 May 2023 17:20:09 +0200 Subject: [PATCH] fix: optional dependency on libc --- Cargo.toml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index a4ff6d5..702a559 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,7 +16,6 @@ digest = "0.10.6" either = "1.6.1" futures = "0.3.17" hex = "0.4.3" -libc = "0.2.144" memmap2 = { version = "0.5.8", optional = true } miette = "5.7.0" reflink = "0.1.3" @@ -37,6 +36,9 @@ tokio = { version = "1.12.0", features = [ tokio-stream = { version = "0.1.7", features = ["io-util"], optional = true } walkdir = "2.3.2" +[target.'cfg(target_os = "linux")'.dependencies] +libc = { version = "0.2.144", optional = true } + [dev-dependencies] async-attributes = { version = "1.1.2" } criterion = "0.4.0" @@ -55,6 +57,6 @@ harness = false [features] default = ["async-std", "mmap"] -mmap = ["memmap2"] +mmap = ["memmap2", "libc"] link_to = [] tokio-runtime = ["tokio", "tokio-stream"]