#bevy #gamedev #game-engine #dylib

bevy_dylib

Force the Bevy Engine to be dynamically linked for faster linking

17 releases (9 breaking)

new 0.13.0 Feb 17, 2024
0.12.1 Nov 30, 2023
0.11.3 Sep 27, 2023
0.11.0 Jul 9, 2023
0.4.0 Dec 19, 2020

#2234 in Game dev

Download history 5216/week @ 2023-10-31 5602/week @ 2023-11-07 4733/week @ 2023-11-14 4862/week @ 2023-11-21 5379/week @ 2023-11-28 4324/week @ 2023-12-05 4760/week @ 2023-12-12 4671/week @ 2023-12-19 3868/week @ 2023-12-26 3195/week @ 2024-01-02 4711/week @ 2024-01-09 4543/week @ 2024-01-16 3830/week @ 2024-01-23 3572/week @ 2024-01-30 4627/week @ 2024-02-06 4617/week @ 2024-02-13

17,541 downloads per month
Used in 39 crates (via bevy)

MIT/Apache

34KB
289 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

~17–51MB
~794K SLoC