Removed duplicate crates added so there could be dynamic crates, now compiled with crate type specified instead.

This commit is contained in:
Sam 2022-09-17 00:48:48 -04:00
parent 23c51af437
commit cfeb197f85
12 changed files with 8 additions and 115 deletions

21
Cargo.lock generated
View File

@ -6840,13 +6840,6 @@ dependencies = [
"veloren-common-ecs",
]
[[package]]
name = "veloren-server-agent-dyn"
version = "0.1.0"
dependencies = [
"veloren-server-agent",
]
[[package]]
name = "veloren-server-cli"
version = "0.13.0"
@ -6964,13 +6957,6 @@ dependencies = [
"veloren-common-dynlib",
]
[[package]]
name = "veloren-voxygen-anim-dyn"
version = "0.10.0"
dependencies = [
"veloren-voxygen-anim",
]
[[package]]
name = "veloren-voxygen-egui"
version = "0.9.0"
@ -6983,13 +6969,6 @@ dependencies = [
"veloren-common-dynlib",
]
[[package]]
name = "veloren-voxygen-egui-dyn"
version = "0.9.0"
dependencies = [
"veloren-voxygen-egui",
]
[[package]]
name = "veloren-voxygen-i18n"
version = "0.13.0"

View File

@ -17,14 +17,11 @@ members = [
"plugin/rt",
"server",
"server/agent",
"server/agent/dyn",
"server-cli",
"voxygen",
"voxygen/anim",
"voxygen/anim/dyn",
"voxygen/i18n",
"voxygen/egui",
"voxygen/egui/dyn",
"world",
"network",
"network/protocol",

View File

@ -238,11 +238,15 @@ fn compile(dyn_package: &str) -> bool {
let output = Command::new("cargo")
.stderr(Stdio::inherit())
.stdout(Stdio::inherit())
.arg("build")
.arg("rustc")
.arg("--package")
.arg(dyn_package)
.arg("--features")
.arg(format!("{}/be-dyn-lib", dyn_package))
.arg("-Z")
.arg("unstable-options")
.arg("--crate-type")
.arg("dylib")
.output()
.unwrap();

View File

@ -1,14 +0,0 @@
[package]
authors = ["Samuel Keiffer <samuelkeiffer@gmail.com>"]
edition = "2021"
name = "veloren-server-agent-dyn"
version = "0.1.0"
[lib]
crate-type = ["dylib"]
[features]
be-dyn-lib = ["veloren-server-agent/be-dyn-lib"]
[dependencies]
veloren-server-agent = { path = "../" }

View File

@ -1,14 +0,0 @@
//! This crate hacks around the inability to dynamically specify the
//! `crate-type` for cargo to build.
//!
//! For more details on the issue this is a decent starting point: https://github.com/rust-lang/cargo/pull/8789
//!
//! This crate avoids use building the dynamic lib when it isn't needed and the
//! same with the non dynamic build. Additionally, this allows compilation to
//! start earlier since a cdylib doesn't pipeline with it's dependencies.
//!
//! NOTE: the `be-dyn-lib` feature must be used for this crate to be useful, it
//! is not on by default because this causes cargo to switch the feature on in
//! the anim crate when compiling the static lib into voxygen.
#[cfg(feature = "be-dyn-lib")]
pub use veloren_server_agent::*;

View File

@ -17,7 +17,7 @@ use {common_dynlib::LoadedLib, lazy_static::lazy_static, std::sync::Arc, std::sy
#[cfg(feature = "use-dyn-lib")]
lazy_static! {
pub static ref LIB: Arc<Mutex<Option<LoadedLib>>> =
common_dynlib::init("veloren-server-agent", "veloren-server-agent-dyn", "agent");
common_dynlib::init("veloren-server-agent", "veloren-server-agent", "agent");
}
#[cfg(feature = "use-dyn-lib")]

View File

@ -1,17 +0,0 @@
[package]
authors = ["Imbris <imbrisf@gmail.com>"]
edition = "2021"
name = "veloren-voxygen-anim-dyn"
version = "0.10.0"
[lib]
# Using dylib instead of cdylib increases the size 3 -> 13 mb
# but it is needed to expose the symbols from the anim crate :(
# effect on compile time appears to be insignificant
crate-type = ["dylib"]
[features]
be-dyn-lib = ["veloren-voxygen-anim/be-dyn-lib"]
[dependencies]
veloren-voxygen-anim = { path = "../" }

View File

@ -1,14 +0,0 @@
//! This crate hacks around the inability to dynamically specify the
//! `crate-type` for cargo to build.
//!
//! For more details on the issue this is a decent starting point: https://github.com/rust-lang/cargo/pull/8789
//!
//! This crate avoids use building the dynamic lib when it isn't needed and the
//! same with the non dynamic build. Additionally, this allows compilation to
//! start earlier since a cdylib doesn't pipeline with it's dependencies.
//!
//! NOTE: the `be-dyn-lib` feature must be used for this crate to be useful, it
//! is not on by default because this causes cargo to switch the feature on in
//! the anim crate when compiling the static lib into voxygen.
#[cfg(feature = "be-dyn-lib")]
pub use veloren_voxygen_anim::*;

View File

@ -99,7 +99,7 @@ pub type Bone = Transform<f32, f32, f32>;
#[cfg(feature = "use-dyn-lib")]
lazy_static! {
static ref LIB: Arc<Mutex<Option<LoadedLib>>> =
common_dynlib::init("veloren-voxygen-anim", "veloren-voxygen-anim-dyn", "anim");
common_dynlib::init("veloren-voxygen-anim", "veloren-voxygen-anim", "anim");
}
#[cfg(feature = "use-dyn-lib")]

View File

@ -1,14 +0,0 @@
[package]
authors = ["Imbris <imbrisf@gmail.com>"]
edition = "2021"
name = "veloren-voxygen-egui-dyn"
version = "0.9.0"
[lib]
crate-type = ["dylib"]
[features]
be-dyn-lib = ["veloren-voxygen-egui/be-dyn-lib"]
[dependencies]
veloren-voxygen-egui = { path = "../" }

View File

@ -1,14 +0,0 @@
//! This crate hacks around the inability to dynamically specify the
//! `crate-type` for cargo to build.
//!
//! For more details on the issue this is a decent starting point: https://github.com/rust-lang/cargo/pull/8789
//!
//! This crate avoids use building the dynamic lib when it isn't needed and the
//! same with the non dynamic build. Additionally, this allows compilation to
//! start earlier since a cdylib doesn't pipeline with it's dependencies.
//!
//! NOTE: the `be-dyn-lib` feature must be used for this crate to be useful, it
//! is not on by default because this causes cargo to switch the feature on in
//! the anim crate when compiling the static lib into voxygen.
#[cfg(feature = "be-dyn-lib")]
pub use veloren_voxygen_egui::*;

View File

@ -37,7 +37,7 @@ use {
#[cfg(feature = "use-dyn-lib")]
lazy_static! {
static ref LIB: Arc<Mutex<Option<LoadedLib>>> =
common_dynlib::init("veloren-voxygen-egui", "veloren-voxygen-egui-dyn", "egui");
common_dynlib::init("veloren-voxygen-egui", "veloren-voxygen-egui", "egui");
}
#[cfg(feature = "use-dyn-lib")]