2022-09-16 00:29:12 +00:00
|
|
|
#[cfg(all(feature = "be-dyn-lib", feature = "use-dyn-lib"))]
|
|
|
|
compile_error!("Can't use both \"be-dyn-lib\" and \"use-dyn-lib\" features at once");
|
|
|
|
|
2022-09-17 01:17:27 +00:00
|
|
|
#[cfg(all(target_os = "windows", feature = "be-dyn-lib"))]
|
|
|
|
#[global_allocator]
|
|
|
|
static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc;
|
|
|
|
|
2022-09-16 00:29:12 +00:00
|
|
|
pub mod action_nodes;
|
|
|
|
pub mod attack;
|
|
|
|
pub mod consts;
|
|
|
|
pub mod data;
|
|
|
|
pub mod util;
|
|
|
|
|
|
|
|
#[cfg(feature = "use-dyn-lib")]
|
2022-09-17 03:14:53 +00:00
|
|
|
use {common_dynlib::LoadedLib, lazy_static::lazy_static, std::sync::Arc, std::sync::Mutex};
|
2022-09-16 00:29:12 +00:00
|
|
|
|
|
|
|
#[cfg(feature = "use-dyn-lib")]
|
|
|
|
lazy_static! {
|
2022-09-16 02:34:44 +00:00
|
|
|
pub static ref LIB: Arc<Mutex<Option<LoadedLib>>> =
|
2022-09-17 04:48:48 +00:00
|
|
|
common_dynlib::init("veloren-server-agent", "veloren-server-agent", "agent");
|
2022-09-16 00:29:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg(feature = "use-dyn-lib")]
|
|
|
|
pub fn init() { lazy_static::initialize(&LIB); }
|