From e27d27c694b83d3be99ab7476689845b3441ce87 Mon Sep 17 00:00:00 2001 From: zonyitoo Date: Wed, 9 Apr 2025 22:27:04 +0800 Subject: [PATCH] fix: build tun only for supported platforms (#1934) --- crates/shadowsocks-service/Cargo.toml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/shadowsocks-service/Cargo.toml b/crates/shadowsocks-service/Cargo.toml index bec400a3..b8b72d6e 100644 --- a/crates/shadowsocks-service/Cargo.toml +++ b/crates/shadowsocks-service/Cargo.toml @@ -178,7 +178,6 @@ flate2 = { version = "1.0", optional = true } brotli = { version = "7.0", optional = true } zstd = { version = "0.13", optional = true } -tun = { version = "0.7", optional = true, features = ["async"] } etherparse = { version = "0.17", optional = true } smoltcp = { version = "0.12", optional = true, default-features = false, features = [ "std", @@ -206,6 +205,9 @@ nix = { version = "0.29", features = ["ioctl"] } [target.'cfg(windows)'.dependencies] windows-sys = { version = "0.59", features = ["Win32_Networking_WinSock"] } +[target.'cfg(any(target_os = "ios", target_os = "macos", target_os = "linux", target_os = "android", target_os = "windows", target_os = "freebsd"))'.dependencies] +tun = { version = "0.7", optional = true, features = ["async"] } + [dev-dependencies] byteorder = "1.5" env_logger = "0.11"