#bevy #linker #game-engine #dynamic #faster #data-driven #build

bevy_dylib

Force the Bevy Engine to be dynamically linked for faster linking

19 unstable releases (9 breaking)

0.13.2 Apr 4, 2024
0.13.1 Mar 18, 2024
0.13.0 Feb 17, 2024
0.12.1 Nov 30, 2023
0.4.0 Dec 19, 2020

#2208 in Game dev

Download history 2997/week @ 2024-01-25 2141/week @ 2024-02-01 2949/week @ 2024-02-08 4018/week @ 2024-02-15 2931/week @ 2024-02-22 3063/week @ 2024-02-29 3275/week @ 2024-03-07 3011/week @ 2024-03-14 3488/week @ 2024-03-21 3306/week @ 2024-03-28 3200/week @ 2024-04-04 2855/week @ 2024-04-11 2994/week @ 2024-04-18 3077/week @ 2024-04-25 2914/week @ 2024-05-02 2663/week @ 2024-05-09

12,101 downloads per month
Used in 56 crates (via bevy)

MIT/Apache

34KB
288 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_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

~16–46MB
~727K SLoC