From fe234920f271023536c6db5dbb61af9dd828cc9c Mon Sep 17 00:00:00 2001 From: Jules Date: Sat, 28 Jun 2025 14:45:01 -0400 Subject: [PATCH] Use `raw-dylib` when linking to Oodle on Windows (#83) This means that the static .lib is no longer required at compile time, but the .dll is still required at runtime. On Linux, the .so is still required at both compile time and runtime, because linking works differently there. --- USAGE.md | 2 +- src/packet/oodle.rs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/USAGE.md b/USAGE.md index 83c4425..b95e810 100644 --- a/USAGE.md +++ b/USAGE.md @@ -26,7 +26,7 @@ Windows and Linux artifacts are built on every commit, under [Github Actions](ht Build Kawari with `cargo build`. -For the World server to function, Kawari needs to be built with `--features oodle`. Place the `oodle-network-shared.lib` (Windows) or `oodle-network-shared.so` (Linux) in a folder created by you named `oodle` before building. +For the World server to function, Kawari needs to be built with `--features oodle`. On Linux, place the `oodle-network-shared.so` in a folder created by you named `oodle` before building. ## Setup diff --git a/src/packet/oodle.rs b/src/packet/oodle.rs index aaeff8e..83664d6 100644 --- a/src/packet/oodle.rs +++ b/src/packet/oodle.rs @@ -7,7 +7,8 @@ use std::{ffi::c_void, ptr::null}; #[cfg(feature = "oodle")] -#[link(name = "oodle-network-shared")] +#[cfg_attr(windows, link(name = "oodle-network-shared", kind = "raw-dylib"))] +#[cfg_attr(not(windows), link(name = "oodle-network-shared"))] unsafe extern "C" { pub fn OodleNetwork1TCP_State_Size() -> isize; pub fn OodleNetwork1_Shared_Size(htbits: i32) -> isize;