From 4923a13c5dd1e55d409714e3b7397daf404afaf0 Mon Sep 17 00:00:00 2001 From: zyflypzlc <47585716+zyflypzlc@users.noreply.github.com> Date: Thu, 30 Jul 2026 20:32:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0easytier=5Fffi=E5=AF=B9Window?= =?UTF-8?q?s7=E7=9A=84=E5=85=BC=E5=AE=B9=20(#2458)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- easytier-contrib/easytier-ffi/Cargo.toml | 6 ++++++ easytier-contrib/easytier-ffi/build.rs | 8 ++++++++ 2 files changed, 14 insertions(+) create mode 100644 easytier-contrib/easytier-ffi/build.rs diff --git a/easytier-contrib/easytier-ffi/Cargo.toml b/easytier-contrib/easytier-ffi/Cargo.toml index d75af201..c2ebe06d 100644 --- a/easytier-contrib/easytier-ffi/Cargo.toml +++ b/easytier-contrib/easytier-ffi/Cargo.toml @@ -26,3 +26,9 @@ log = "0.4" serde = { version = "1.0", features = ["derive"] } serde_json = "1" uuid = "1.17.0" + +[build-dependencies] +thunk-rs = { git = "https://github.com/easytier/thunk.git", default-features = false, features = [ + "win7", +] } + diff --git a/easytier-contrib/easytier-ffi/build.rs b/easytier-contrib/easytier-ffi/build.rs new file mode 100644 index 00000000..df95c7b0 --- /dev/null +++ b/easytier-contrib/easytier-ffi/build.rs @@ -0,0 +1,8 @@ +fn main() { + let target_os = std::env::var("CARGO_CFG_TARGET_OS").unwrap_or_default(); + let target_arch = std::env::var("CARGO_CFG_TARGET_ARCH").unwrap_or_default(); + + if target_os == "windows" && (target_arch == "x86" || target_arch == "x86_64") { + thunk::thunk(); + } +}