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.
Do not enable this feature for release builds because this would require you to ship
libbevy_dylib.so with your game.
The easiest way to enable dynamic linking is to use the
--features bevy/dynamic_linking flag when
cargo run command:
cargo run --features bevy/dynamic_linking
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
features = ["dynamic_linking"]
Manually enabling dynamic linking is achieved by adding
bevy_dylib as a dependency and
adding the following code to the
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:
#[cfg(debug_assertions)] // new