gate libloading to conduwuit_mods feature and cfg only

Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
strawberry 2025-01-10 10:46:32 -05:00
parent 53d03bbb1f
commit 4c2999ccd1
10 changed files with 38 additions and 9 deletions

View file

@ -50,6 +50,9 @@ zstd_compression = [
]
perf_measurements = []
sentry_telemetry = []
conduwuit_mods = [
"dep:libloading"
]
[dependencies]
argon2.workspace = true
@ -75,6 +78,7 @@ ipaddress.workspace = true
itertools.workspace = true
libc.workspace = true
libloading.workspace = true
libloading.optional = true
log.workspace = true
num-traits.workspace = true
rand.workspace = true

View file

@ -25,7 +25,7 @@ pub use crate as conduwuit_core;
rustc_flags_capture! {}
#[cfg(not(conduwuit_mods))]
#[cfg(any(not(conduwuit_mods), not(feature = "conduwuit_mods")))]
pub mod mods {
#[macro_export]
macro_rules! mod_ctor {

View file

@ -1,4 +1,4 @@
#![cfg(conduwuit_mods)]
#![cfg(all(conduwuit_mods, feature = "conduwuit_mods"))]
pub(crate) use libloading::os::unix::{Library, Symbol};

View file

@ -59,7 +59,7 @@ impl Server {
}
pub fn reload(&self) -> Result<()> {
if cfg!(not(conduwuit_mods)) {
if cfg!(any(not(conduwuit_mods), not(feature = "conduwuit_mods"))) {
return Err!("Reloading not enabled");
}