2024-03-23 02:22:52 +00:00
|
|
|
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
|
2024-03-25 18:52:50 +00:00
|
|
|
#![doc(
|
|
|
|
html_logo_url = "https://bevyengine.org/assets/icon.png",
|
|
|
|
html_favicon_url = "https://bevyengine.org/assets/icon.png"
|
|
|
|
)]
|
2021-06-18 00:08:39 +00:00
|
|
|
|
2020-11-10 03:26:08 +00:00
|
|
|
//! Forces dynamic linking of Bevy.
|
|
|
|
//!
|
2022-01-02 10:51:08 +00:00
|
|
|
//! 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 recommended way
|
|
|
|
//!
|
2023-01-23 14:28:00 +00:00
|
|
|
//! The easiest way to enable dynamic linking is to use the `--features bevy/dynamic_linking` flag when
|
2022-01-02 10:51:08 +00:00
|
|
|
//! using the `cargo run` command:
|
|
|
|
//!
|
2023-01-23 14:28:00 +00:00
|
|
|
//! `cargo run --features bevy/dynamic_linking`
|
2022-01-02 10:51:08 +00:00
|
|
|
//!
|
|
|
|
//! ## The unrecommended way
|
|
|
|
//!
|
2023-01-23 14:28:00 +00:00
|
|
|
//! It is also possible to enable the `dynamic_linking` feature inside of the `Cargo.toml` file. This is
|
2022-01-02 10:51:08 +00:00
|
|
|
//! 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.
|
|
|
|
//!
|
2023-01-23 14:28:00 +00:00
|
|
|
//! To enable dynamic linking inside of the `Cargo.toml` file add the `dynamic_linking` feature to the
|
2022-01-02 10:51:08 +00:00
|
|
|
//! bevy dependency:
|
|
|
|
//!
|
2023-01-23 14:28:00 +00:00
|
|
|
//! `features = ["dynamic_linking"]`
|
2022-01-02 10:51:08 +00:00
|
|
|
//!
|
|
|
|
//! ## 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:
|
|
|
|
//!
|
2022-01-07 09:25:12 +00:00
|
|
|
//! ```
|
2022-01-02 10:51:08 +00:00
|
|
|
//! #[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:
|
|
|
|
//!
|
2022-01-07 09:25:12 +00:00
|
|
|
//! ```
|
2022-01-02 10:51:08 +00:00
|
|
|
//! #[allow(unused_imports)]
|
|
|
|
//! #[cfg(debug_assertions)] // new
|
|
|
|
//! use bevy_dylib;
|
|
|
|
//! ```
|
2020-11-10 03:26:08 +00:00
|
|
|
|
|
|
|
// Force linking of the main bevy crate
|
|
|
|
#[allow(unused_imports)]
|
2024-03-23 02:22:52 +00:00
|
|
|
#[allow(clippy::single_component_path_imports)]
|
2020-11-10 03:26:08 +00:00
|
|
|
use bevy_internal;
|