#bevy #linker #game-engine #dynamic #build #faster #linked

bevy_dylib

Force the Bevy Engine to be dynamically linked for faster linking

32 releases

0.15.2 Feb 7, 2025
0.15.0 Nov 29, 2024
0.14.0 Jul 4, 2024
0.13.1 Mar 18, 2024
0.4.0 Dec 19, 2020

#2783 in Game dev

Download history 5502/week @ 2024-10-27 4997/week @ 2024-11-03 2093/week @ 2024-11-10 3119/week @ 2024-11-17 5617/week @ 2024-11-24 5659/week @ 2024-12-01 7234/week @ 2024-12-08 8047/week @ 2024-12-15 3172/week @ 2024-12-22 2860/week @ 2024-12-29 7895/week @ 2025-01-05 10658/week @ 2025-01-12 9482/week @ 2025-01-19 4381/week @ 2025-01-26 8335/week @ 2025-02-02 9602/week @ 2025-02-09

32,116 downloads per month
Used in 65 crates (via bevy)

MIT/Apache

67KB
235 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

~20–32MB
~527K SLoC