gate libloading to conduwuit_mods feature and cfg only
Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
parent
53d03bbb1f
commit
4c2999ccd1
10 changed files with 38 additions and 9 deletions
|
@ -135,6 +135,9 @@ zstd_compression = [
|
|||
"conduwuit-database/zstd_compression",
|
||||
"conduwuit-router/zstd_compression",
|
||||
]
|
||||
conduwuit_mods = [
|
||||
"conduwuit-core/conduwuit_mods",
|
||||
]
|
||||
|
||||
[dependencies]
|
||||
conduwuit-admin.workspace = true
|
||||
|
|
|
@ -37,7 +37,7 @@ fn main() -> Result<(), Error> {
|
|||
|
||||
/// Operate the server normally in release-mode static builds. This will start,
|
||||
/// run and stop the server within the asynchronous runtime.
|
||||
#[cfg(not(conduwuit_mods))]
|
||||
#[cfg(any(not(conduwuit_mods), not(feature = "conduwuit_mods")))]
|
||||
#[tracing::instrument(
|
||||
name = "main",
|
||||
parent = None,
|
||||
|
@ -89,7 +89,7 @@ async fn async_main(server: &Arc<Server>) -> Result<(), Error> {
|
|||
/// Operate the server in developer-mode dynamic builds. This will start, run,
|
||||
/// and hot-reload portions of the server as-needed before returning for an
|
||||
/// actual shutdown. This is not available in release-mode or static builds.
|
||||
#[cfg(conduwuit_mods)]
|
||||
#[cfg(all(conduwuit_mods, feature = "conduwuit_mods"))]
|
||||
async fn async_main(server: &Arc<Server>) -> Result<(), Error> {
|
||||
let mut starts = true;
|
||||
let mut reloads = true;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#![cfg(conduwuit_mods)]
|
||||
#![cfg(all(conduwuit_mods, feature = "conduwuit_mods"))]
|
||||
|
||||
#[unsafe(no_link)]
|
||||
extern crate conduwuit_service;
|
||||
|
|
|
@ -23,7 +23,7 @@ pub(crate) struct Server {
|
|||
#[cfg(feature = "sentry_telemetry")]
|
||||
_sentry_guard: Option<::sentry::ClientInitGuard>,
|
||||
|
||||
#[cfg(conduwuit_mods)]
|
||||
#[cfg(all(conduwuit_mods, feature = "conduwuit_mods"))]
|
||||
// Module instances; TODO: move to mods::loaded mgmt vector
|
||||
pub(crate) mods: tokio::sync::RwLock<Vec<conduwuit::mods::Module>>,
|
||||
}
|
||||
|
@ -75,7 +75,7 @@ impl Server {
|
|||
#[cfg(feature = "sentry_telemetry")]
|
||||
_sentry_guard: sentry_guard,
|
||||
|
||||
#[cfg(conduwuit_mods)]
|
||||
#[cfg(all(conduwuit_mods, feature = "conduwuit_mods"))]
|
||||
mods: tokio::sync::RwLock::new(Vec::new()),
|
||||
}))
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ pub(super) async fn signal(server: Arc<Server>) {
|
|||
use unix::SignalKind;
|
||||
|
||||
const CONSOLE: bool = cfg!(feature = "console");
|
||||
const RELOADING: bool = cfg!(all(conduwuit_mods, not(CONSOLE)));
|
||||
const RELOADING: bool = cfg!(all(conduwuit_mods, feature = "conduwuit_mods", not(CONSOLE)));
|
||||
|
||||
let mut quit = unix::signal(SignalKind::quit()).expect("SIGQUIT handler");
|
||||
let mut term = unix::signal(SignalKind::terminate()).expect("SIGTERM handler");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue