#bevy

bevy_dylib

Force the Bevy Engine to be dynamically linked for faster linking

8 releases (5 breaking)

0.9.1 Dec 1, 2022
0.9.0 Nov 12, 2022
0.8.1 Aug 23, 2022
0.8.0 Jul 30, 2022
0.4.0 Dec 19, 2020

#270 in Game dev

Download history 954/week @ 2022-10-13 1045/week @ 2022-10-20 1639/week @ 2022-10-27 2065/week @ 2022-11-03 2641/week @ 2022-11-10 2382/week @ 2022-11-17 1134/week @ 2022-11-24 1585/week @ 2022-12-01 2236/week @ 2022-12-08 1105/week @ 2022-12-15 1403/week @ 2022-12-22 1375/week @ 2022-12-29 1144/week @ 2023-01-05 1269/week @ 2023-01-12 1669/week @ 2023-01-19 1479/week @ 2023-01-26

5,667 downloads per month
Used in 14 crates (via bevy)

MIT/Apache

20KB
239 lines

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 flag when using the cargo run command:

cargo run --features bevy/dynamic

The unrecommended way

It is also possible to enable the dynamic 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 feature to the bevy dependency:

features = ["dynamic"]

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

~10–18MB
~349K SLoC