fix: hot-anim feature

This commit is contained in:
Songtronix 2020-06-24 14:35:52 +02:00
parent c8b708b2d3
commit 750b9e198d
4 changed files with 25 additions and 6 deletions

14
Cargo.lock generated
View File

@ -4187,6 +4187,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a41f40ed0e162c911ac6fcb53ecdc8134c46905fdbbae8c50add462a538b495f"
dependencies = [
"cfg-if",
"tracing-attributes",
"tracing-core",
]
@ -4201,6 +4202,17 @@ dependencies = [
"tracing-subscriber",
]
[[package]]
name = "tracing-attributes"
version = "0.1.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "99bbad0de3fd923c9c3232ead88510b783e5a4d16a6154adffa3d53308de984c"
dependencies = [
"proc-macro2 1.0.18",
"quote 1.0.7",
"syn 1.0.31",
]
[[package]]
name = "tracing-core"
version = "0.1.10"
@ -4580,8 +4592,8 @@ version = "0.6.0"
dependencies = [
"lazy_static",
"libloading 0.6.2",
"log",
"notify",
"tracing",
"vek",
"veloren-common",
]

View File

@ -72,7 +72,7 @@ authc = { git = "https://gitlab.com/veloren/auth.git", rev = "223a4097f7ebc8d451
const-tweaker = { version = "0.2.5", optional = true }
# Logging
tracing = { version = "0.1", default-features = false }
tracing = "0.1"
tracing-subscriber = { version = "0.2.3", default-features = false, features = ["env-filter", "fmt", "chrono", "ansi", "smallvec" , "tracing-log"] }
tracing-log = "0.1.1"
tracing-appender = "0.1"

View File

@ -11,7 +11,7 @@ name = "voxygen_anim"
#crate-type = ["lib", "cdylib"]
[features]
use-dyn-lib = ["libloading", "notify", "lazy_static", "log"]
use-dyn-lib = ["libloading", "notify", "lazy_static", "tracing"]
be-dyn-lib = []
default = ["be-dyn-lib"]
@ -22,4 +22,4 @@ common = { package = "veloren-common", path = "../../../common" }
libloading = { version = "0.6.2", optional = true }
notify = { version = "5.0.0-pre.2", optional = true }
lazy_static = { version = "1.4.0", optional = true }
log = { version = "0.4.8", optional = true }
tracing = { version = "0.1", optional = true }

View File

@ -7,6 +7,7 @@ use std::{
thread,
time::Duration,
};
use tracing::{error, warn};
lazy_static! {
pub static ref LIB: Mutex<Option<LoadedLib>> = Mutex::new(Some(LoadedLib::compile_load()));
@ -29,9 +30,15 @@ impl LoadedLib {
fn load() -> Self {
#[cfg(target_os = "windows")]
let lib = Library::new("../target/debug/voxygen_anim_active.dll").unwrap();
let lib = Library::new("../target/debug/voxygen_anim_active.dll").expect(
"To use hot animation reloading you need to uncomment a line in \
`voxygen/src/anim/Cargo.toml`.",
);
#[cfg(not(target_os = "windows"))]
let lib = Library::new("../target/debug/libvoxygen_anim.so").unwrap();
let lib = Library::new("../target/debug/libvoxygen_anim.so").expect(
"To use hot animation reloading you need to uncomment a line in \
`voxygen/src/anim/Cargo.toml`.",
);
Self { lib }
}