1
Fork 0
mirror of https://github.com/redstrate/Kawari.git synced 2025-06-30 11:47:45 +00:00

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.
This commit is contained in:
Jules 2025-06-28 14:45:01 -04:00 committed by GitHub
parent 66da9abc90
commit fe234920f2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 2 deletions

View file

@ -26,7 +26,7 @@ Windows and Linux artifacts are built on every commit, under [Github Actions](ht
Build Kawari with `cargo build`. 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 ## Setup

View file

@ -7,7 +7,8 @@
use std::{ffi::c_void, ptr::null}; use std::{ffi::c_void, ptr::null};
#[cfg(feature = "oodle")] #[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" { unsafe extern "C" {
pub fn OodleNetwork1TCP_State_Size() -> isize; pub fn OodleNetwork1TCP_State_Size() -> isize;
pub fn OodleNetwork1_Shared_Size(htbits: i32) -> isize; pub fn OodleNetwork1_Shared_Size(htbits: i32) -> isize;