#bevy #game-engine #linker

bevy_dylib

Force the Bevy Engine to be dynamically linked for faster linking

35 releases

Uses new Rust 2024

new 0.16.0-rc.2 Mar 26, 2025
0.15.3 Feb 24, 2025
0.15.0 Nov 29, 2024
0.14.0 Jul 4, 2024
0.4.0 Dec 19, 2020

#2966 in Game dev

Download history 5002/week @ 2024-12-04 9805/week @ 2024-12-11 5751/week @ 2024-12-18 1856/week @ 2024-12-25 5973/week @ 2025-01-01 6131/week @ 2025-01-08 11542/week @ 2025-01-15 7470/week @ 2025-01-22 6282/week @ 2025-01-29 9079/week @ 2025-02-05 8522/week @ 2025-02-12 5747/week @ 2025-02-19 8262/week @ 2025-02-26 5299/week @ 2025-03-05 10951/week @ 2025-03-12 7824/week @ 2025-03-19

32,815 downloads per month
Used in 62 crates (via bevy)

MIT/Apache

67KB
257 lines

Bevy Dynamic Library

License Crates.io Downloads Docs Discord


lib.rs:

Forces dynamic linking of Bevy.

Dynamic linking causes Bevy to be built and linked as a dynamic library. This will make incremental builds compile much faster.

Warning

Do not enable this feature for release builds because this would require you to ship libstd.so and libbevy_dylib.so with your game.

Enabling dynamic linking

The easiest way to enable dynamic linking is to use the --features bevy/dynamic_linking flag when using the cargo run command:

cargo run --features bevy/dynamic_linking

The unrecommended way

It is also possible to enable the dynamic_linking feature inside of the Cargo.toml file. This is unrecommended because it requires you to remove this feature every time you want to create a release build to avoid having to ship additional files with your game.

To enable dynamic linking inside of the Cargo.toml file add the dynamic_linking feature to the bevy dependency:

features = ["dynamic_linking"]

The manual way

Manually enabling dynamic linking is achieved by adding bevy_dylib as a dependency and adding the following code to the main.rs file:

#[allow(unused_imports)]
use bevy_dylib;

It is recommended to disable the bevy_dylib dependency in release mode by adding the following code to the use statement to avoid having to ship additional files with your game:

#[allow(unused_imports)]
#[cfg(debug_assertions)] // new
use bevy_dylib;

Dependencies

~11–17MB
~228K SLoC