Skip to content

Commit 68e72ba

Browse files
committed
Add bevy_dylib to force dynamic linking of bevy
This easily improve compilation time by 2x
1 parent d682cc6 commit 68e72ba

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+454
-250
lines changed

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ jobs:
8383
uses: actions-rs/cargo@v1
8484
with:
8585
command: check
86-
args: --target wasm32-unknown-unknown --no-default-features --features bevy_winit,x11,hdr,bevy_gltf
86+
args: --target wasm32-unknown-unknown --no-default-features --features bevy/bevy_winit,bevy/x11,bevy/hdr,bevy/bevy_gltf
8787

8888
build-android:
8989
runs-on: ubuntu-latest

Cargo.toml

+6-70
Original file line numberDiff line numberDiff line change
@@ -1,90 +1,26 @@
11
[package]
2-
name = "bevy"
2+
name = "bevy_examples"
33
version = "0.3.0"
44
edition = "2018"
55
authors = [
66
"Bevy Contributors <bevyengine@gmail.com>",
77
"Carter Anderson <mcanders1@gmail.com>",
88
]
9-
description = "A refreshingly simple data-driven game engine and app framework"
9+
description = "Examples for the Bevy game engine"
1010
homepage = "https://bevyengine.org"
1111
repository = "https://github.com/bevyengine/bevy"
1212
license = "MIT"
1313
keywords = ["game", "engine", "gamedev", "graphics", "bevy"]
1414
categories = ["game-engines", "graphics", "gui", "rendering"]
15-
readme = "README.md"
1615
exclude = ["assets/**/*", "tools/**/*", ".github/**/*", "crates/**/*"]
1716

18-
[features]
19-
default = [
20-
"bevy_audio",
21-
"bevy_dynamic_plugin",
22-
"bevy_gilrs",
23-
"bevy_gltf",
24-
"bevy_wgpu",
25-
"bevy_winit",
26-
"render",
27-
"png",
28-
"hdr",
29-
"mp3",
30-
"x11",
31-
]
32-
33-
profiler = ["bevy_ecs/profiler", "bevy_diagnostic/profiler"]
34-
wgpu_trace = ["bevy_wgpu/trace"]
35-
36-
# Rendering support
37-
render = ["bevy_pbr", "bevy_render", "bevy_sprite", "bevy_text", "bevy_ui"]
38-
# Image format support for texture loading (PNG and HDR are enabled by default)
39-
png = ["bevy_render/png"]
40-
hdr = ["bevy_render/hdr"]
41-
42-
# Audio format support (MP3 is enabled by default)
43-
mp3 = ["bevy_audio/mp3"]
44-
flac = ["bevy_audio/flac"]
45-
wav = ["bevy_audio/wav"]
46-
vorbis = ["bevy_audio/vorbis"]
47-
48-
serialize = ["bevy_input/serialize"]
49-
50-
# Display server protocol support (X11 is enabled by default)
51-
wayland = ["bevy_winit/wayland"]
52-
x11 = ["bevy_winit/x11"]
53-
5417
[workspace]
5518
members = ["crates/*", "crates/bevy_ecs/hecs", "examples/ios"]
5619
exclude = ["benches"]
5720

58-
[dependencies]
59-
# bevy
60-
bevy_app = { path = "crates/bevy_app", version = "0.3.0" }
61-
bevy_asset = { path = "crates/bevy_asset", version = "0.3.0" }
62-
bevy_type_registry = { path = "crates/bevy_type_registry", version = "0.3.0" }
63-
bevy_core = { path = "crates/bevy_core", version = "0.3.0" }
64-
bevy_diagnostic = { path = "crates/bevy_diagnostic", version = "0.3.0" }
65-
bevy_ecs = { path = "crates/bevy_ecs", version = "0.3.0" }
66-
bevy_input = { path = "crates/bevy_input", version = "0.3.0" }
67-
bevy_math = { path = "crates/bevy_math", version = "0.3.0" }
68-
bevy_property = { path = "crates/bevy_property", version = "0.3.0" }
69-
bevy_scene = { path = "crates/bevy_scene", version = "0.3.0" }
70-
bevy_transform = { path = "crates/bevy_transform", version = "0.3.0" }
71-
bevy_utils = { path = "crates/bevy_utils", version = "0.3.0" }
72-
bevy_window = { path = "crates/bevy_window", version = "0.3.0" }
73-
bevy_tasks = { path = "crates/bevy_tasks", version = "0.3.0" }
74-
# bevy (optional)
75-
bevy_audio = { path = "crates/bevy_audio", optional = true, version = "0.3.0" }
76-
bevy_gltf = { path = "crates/bevy_gltf", optional = true, version = "0.3.0" }
77-
bevy_pbr = { path = "crates/bevy_pbr", optional = true, version = "0.3.0" }
78-
bevy_render = { path = "crates/bevy_render", optional = true, version = "0.3.0" }
79-
bevy_dynamic_plugin = { path = "crates/bevy_dynamic_plugin", optional = true, version = "0.3.0" }
80-
bevy_sprite = { path = "crates/bevy_sprite", optional = true, version = "0.3.0" }
81-
bevy_text = { path = "crates/bevy_text", optional = true, version = "0.3.0" }
82-
bevy_ui = { path = "crates/bevy_ui", optional = true, version = "0.3.0" }
83-
bevy_wgpu = { path = "crates/bevy_wgpu", optional = true, version = "0.3.0" }
84-
bevy_winit = { path = "crates/bevy_winit", optional = true, version = "0.3.0" }
85-
bevy_gilrs = { path = "crates/bevy_gilrs", optional = true, version = "0.3.0" }
86-
8721
[dev-dependencies]
22+
bevy = { path = "crates/bevy", version = "0.3.0" }
23+
bevy_dylib = { path = "crates/bevy_dylib", version = "0.3.0" }
8824
rand = "0.7.3"
8925
serde = { version = "1", features = ["derive"] }
9026
log = "0.4"
@@ -313,12 +249,12 @@ required-features = []
313249
[[example]]
314250
name = "winit_wasm"
315251
path = "examples/wasm/winit_wasm.rs"
316-
required-features = ["bevy_winit"]
252+
required-features = ["bevy/bevy_winit"]
317253

318254
[[example]]
319255
name = "assets_wasm"
320256
path = "examples/wasm/assets_wasm.rs"
321-
required-features = ["bevy_winit"]
257+
required-features = ["bevy/bevy_winit"]
322258

323259
[[example]]
324260
name = "android"

crates/bevy/Cargo.toml

+81
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
[package]
2+
name = "bevy"
3+
version = "0.3.0"
4+
edition = "2018"
5+
authors = [
6+
"Bevy Contributors <bevyengine@gmail.com>",
7+
"Carter Anderson <mcanders1@gmail.com>",
8+
]
9+
description = "A refreshingly simple data-driven game engine and app framework"
10+
homepage = "https://bevyengine.org"
11+
repository = "https://github.com/bevyengine/bevy"
12+
license = "MIT"
13+
keywords = ["game", "engine", "gamedev", "graphics", "bevy"]
14+
categories = ["game-engines", "graphics", "gui", "rendering"]
15+
readme = "README.md"
16+
17+
[features]
18+
default = [
19+
"bevy_audio",
20+
"bevy_dynamic_plugin",
21+
"bevy_gilrs",
22+
"bevy_gltf",
23+
"bevy_wgpu",
24+
"bevy_winit",
25+
"render",
26+
"png",
27+
"hdr",
28+
"mp3",
29+
"x11",
30+
]
31+
32+
profiler = ["bevy_ecs/profiler", "bevy_diagnostic/profiler"]
33+
wgpu_trace = ["bevy_wgpu/trace"]
34+
35+
# Rendering support
36+
render = ["bevy_pbr", "bevy_render", "bevy_sprite", "bevy_text", "bevy_ui"]
37+
# Image format support for texture loading (PNG and HDR are enabled by default)
38+
png = ["bevy_render/png"]
39+
hdr = ["bevy_render/hdr"]
40+
41+
# Audio format support (MP3 is enabled by default)
42+
mp3 = ["bevy_audio/mp3"]
43+
flac = ["bevy_audio/flac"]
44+
wav = ["bevy_audio/wav"]
45+
vorbis = ["bevy_audio/vorbis"]
46+
47+
serialize = ["bevy_input/serialize"]
48+
49+
# Display server protocol support (X11 is enabled by default)
50+
wayland = ["bevy_winit/wayland"]
51+
x11 = ["bevy_winit/x11"]
52+
53+
[dependencies]
54+
# bevy
55+
bevy_app = { path = "../bevy_app", version = "0.3.0" }
56+
bevy_asset = { path = "../bevy_asset", version = "0.3.0" }
57+
bevy_type_registry = { path = "../bevy_type_registry", version = "0.3.0" }
58+
bevy_core = { path = "../bevy_core", version = "0.3.0" }
59+
bevy_diagnostic = { path = "../bevy_diagnostic", version = "0.3.0" }
60+
bevy_ecs = { path = "../bevy_ecs", version = "0.3.0" }
61+
bevy_input = { path = "../bevy_input", version = "0.3.0" }
62+
bevy_math = { path = "../bevy_math", version = "0.3.0" }
63+
bevy_property = { path = "../bevy_property", version = "0.3.0" }
64+
bevy_scene = { path = "../bevy_scene", version = "0.3.0" }
65+
bevy_transform = { path = "../bevy_transform", version = "0.3.0" }
66+
bevy_utils = { path = "../bevy_utils", version = "0.3.0" }
67+
bevy_window = { path = "../bevy_window", version = "0.3.0" }
68+
bevy_tasks = { path = "../bevy_tasks", version = "0.3.0" }
69+
# bevy (optional)
70+
bevy_audio = { path = "../bevy_audio", optional = true, version = "0.3.0" }
71+
bevy_gltf = { path = "../bevy_gltf", optional = true, version = "0.3.0" }
72+
bevy_pbr = { path = "../bevy_pbr", optional = true, version = "0.3.0" }
73+
bevy_render = { path = "../bevy_render", optional = true, version = "0.3.0" }
74+
bevy_dynamic_plugin = { path = "../bevy_dynamic_plugin", optional = true, version = "0.3.0" }
75+
bevy_sprite = { path = "../bevy_sprite", optional = true, version = "0.3.0" }
76+
bevy_text = { path = "../bevy_text", optional = true, version = "0.3.0" }
77+
bevy_ui = { path = "../bevy_ui", optional = true, version = "0.3.0" }
78+
bevy_wgpu = { path = "../bevy_wgpu", optional = true, version = "0.3.0" }
79+
bevy_winit = { path = "../bevy_winit", optional = true, version = "0.3.0" }
80+
bevy_gilrs = { path = "../bevy_gilrs", optional = true, version = "0.3.0" }
81+

crates/bevy/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../README.md
File renamed without changes.

crates/bevy/src/lib.rs

+174
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
//! [![](https://bevyengine.org/assets/bevy_logo_docs.svg)](https://bevyengine.org)
2+
//!
3+
//! Bevy is an open-source modular game engine built in Rust, with a focus on developer productivity and performance.
4+
//!
5+
//! Check out the [Bevy website](https://bevyengine.org) for more information, read the
6+
//! [Bevy Book](https://bevyengine.org/learn/book/introduction) for a step-by-step guide, and [engage with our
7+
//! community](https://bevyengine.org/community/) if you have any questions or ideas!
8+
//!
9+
//! ## Example
10+
//!Here is a simple "Hello World" Bevy app:
11+
//! ```
12+
//!use bevy::prelude::*;
13+
//!
14+
//!fn main() {
15+
//! App::build()
16+
//! .add_system(hello_world_system.system())
17+
//! .run();
18+
//!}
19+
//!
20+
//!fn hello_world_system() {
21+
//! println!("hello world");
22+
//!}
23+
//! ```
24+
25+
//! Don't let the simplicity of the example above fool you. Bevy is a [fully featured game engine](https://bevyengine.org)
26+
//! and it gets more powerful every day!
27+
//!
28+
//! ### This Crate
29+
//! The `bevy` crate is just a container crate that makes it easier to consume Bevy components.
30+
//! The defaults provide a "full" engine experience, but you can easily enable / disable features
31+
//! in your project's `Cargo.toml` to meet your specific needs. See Bevy's `Cargo.toml` for a full list of features available.
32+
//!
33+
//! If you prefer, you can also consume the individual bevy crates directly.
34+
//! Each module in the root of this crate, except for the prelude, can be found on crates.io
35+
//! with `bevy_` appended to the front, e.g. `app` -> [`bevy_app`](https://docs.rs/bevy_app/*/bevy_app/).
36+
37+
#![doc(
38+
html_logo_url = "https://bevyengine.org/assets/icon.png",
39+
html_favicon_url = "https://bevyengine.org/assets/icon.png"
40+
)]
41+
42+
/// `use bevy::prelude::*;` to import common components, bundles, and plugins.
43+
pub mod prelude;
44+
45+
mod default_plugins;
46+
pub use default_plugins::*;
47+
48+
pub mod app {
49+
//! Build bevy apps, create plugins, and read events.
50+
pub use bevy_app::*;
51+
}
52+
53+
pub mod asset {
54+
//! Load and store assets and resources for Apps.
55+
pub use bevy_asset::*;
56+
}
57+
58+
pub mod core {
59+
//! Contains core plugins and utilities for time.
60+
pub use bevy_core::*;
61+
}
62+
63+
pub mod diagnostic {
64+
//! Useful diagnostic plugins and types for bevy apps.
65+
pub use bevy_diagnostic::*;
66+
}
67+
68+
pub mod ecs {
69+
//! Bevy's entity-component-system.
70+
pub use bevy_ecs::*;
71+
}
72+
73+
pub mod input {
74+
//! Resources and events for inputs, e.g. mouse/keyboard, touch, gamepads, etc.
75+
pub use bevy_input::*;
76+
}
77+
78+
pub mod math {
79+
//! Math types (Vec3, Mat4, Quat, etc) and helpers.
80+
pub use bevy_math::*;
81+
}
82+
83+
pub mod property {
84+
//! Dynamically interact with struct fields and names.
85+
pub use bevy_property::*;
86+
}
87+
88+
pub mod scene {
89+
//! Save/load collections of entities and components to/from file.
90+
pub use bevy_scene::*;
91+
}
92+
93+
pub mod tasks {
94+
//! Pools for async, IO, and compute tasks.
95+
pub use bevy_tasks::*;
96+
}
97+
98+
pub mod transform {
99+
//! Local and global transforms (e.g. translation, scale, rotation).
100+
pub use bevy_transform::*;
101+
}
102+
103+
pub mod type_registry {
104+
//! Registered types and components can be used when loading scenes.
105+
pub use bevy_type_registry::*;
106+
}
107+
108+
pub mod utils {
109+
pub use bevy_utils::*;
110+
}
111+
112+
pub mod window {
113+
//! Configuration, creation, and management of one or more windows.
114+
pub use bevy_window::*;
115+
}
116+
117+
#[cfg(feature = "bevy_audio")]
118+
pub mod audio {
119+
//! Provides types and plugins for audio playback.
120+
pub use bevy_audio::*;
121+
}
122+
123+
#[cfg(feature = "bevy_gltf")]
124+
pub mod gltf {
125+
//! Support for GLTF file loading.
126+
pub use bevy_gltf::*;
127+
}
128+
129+
#[cfg(feature = "bevy_pbr")]
130+
pub mod pbr {
131+
//! Physically based rendering.
132+
//! **Note**: true PBR has not yet been implemented; the name `pbr` is aspirational.
133+
pub use bevy_pbr::*;
134+
}
135+
136+
#[cfg(feature = "bevy_render")]
137+
pub mod render {
138+
//! Cameras, meshes, textures, shaders, and pipelines.
139+
pub use bevy_render::*;
140+
}
141+
142+
#[cfg(feature = "bevy_sprite")]
143+
pub mod sprite {
144+
//! Items for sprites, rects, texture atlases, etc.
145+
pub use bevy_sprite::*;
146+
}
147+
148+
#[cfg(feature = "bevy_text")]
149+
pub mod text {
150+
//! Text drawing, styling, and font assets.
151+
pub use bevy_text::*;
152+
}
153+
154+
#[cfg(feature = "bevy_ui")]
155+
pub mod ui {
156+
//! User interface components and widgets.
157+
pub use bevy_ui::*;
158+
}
159+
160+
#[cfg(feature = "bevy_winit")]
161+
pub mod winit {
162+
pub use bevy_winit::*;
163+
}
164+
165+
#[cfg(feature = "bevy_wgpu")]
166+
pub mod wgpu {
167+
//! A render backend utilizing [wgpu](https://github.com/gfx-rs/wgpu-rs).
168+
pub use bevy_wgpu::*;
169+
}
170+
171+
#[cfg(feature = "bevy_dynamic_plugin")]
172+
pub mod dynamic_plugin {
173+
pub use bevy_dynamic_plugin::*;
174+
}
File renamed without changes.

crates/bevy_dylib/Cargo.toml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[package]
2+
name = "bevy_dylib"
3+
version = "0.3.0"
4+
edition = "2018"
5+
authors = [
6+
"Bevy Contributors <bevyengine@gmail.com>",
7+
"Carter Anderson <mcanders1@gmail.com>",
8+
]
9+
description = "Force the Bevy Engine to be dynamically linked for faster linking"
10+
homepage = "https://bevyengine.org"
11+
repository = "https://github.com/bevyengine/bevy"
12+
license = "MIT"
13+
keywords = ["bevy"]
14+
15+
[lib]
16+
crate-type = ["dylib"]
17+
18+
[dependencies]
19+
bevy = { path = "../bevy", version = "0.3.0", default-features = false }

0 commit comments

Comments
 (0)