Skip to content

Commit

Permalink
Rename dynamic feature (bevyengine#7340)
Browse files Browse the repository at this point in the history
# Objective

- Fixes bevyengine#7334

## Solution

- Rename `dynamic` feature to `dynamic_linking`.

---

## Migration Guide
- `dynamic` feature was renamed to `dynamic_linking`
  • Loading branch information
lewiszlw authored and ItsDoot committed Feb 1, 2023
1 parent 69d5d7e commit 8efea1b
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ default = [
]

# Force dynamic linking, which improves iterative compile times
dynamic = ["bevy_dylib", "bevy_internal/dynamic"]
dynamic_linking = ["bevy_dylib", "bevy_internal/dynamic_linking"]

# Optional bevy crates
bevy_animation = ["bevy_internal/bevy_animation"]
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_diagnostic/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ keywords = ["bevy"]

[features]
# Disables diagnostics that are unsupported when Bevy is dynamically linked
dynamic = []
dynamic_linking = []

[dependencies]
# bevy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ impl SystemInformationDiagnosticsPlugin {
target_os = "android",
target_os = "macos"
),
not(feature = "dynamic")
not(feature = "dynamic_linking")
))]
pub mod internal {
use bevy_ecs::{prelude::ResMut, system::Local};
Expand Down Expand Up @@ -142,7 +142,7 @@ pub mod internal {
target_os = "android",
target_os = "macos"
),
not(feature = "dynamic")
not(feature = "dynamic_linking")
)))]
pub mod internal {
pub(crate) fn setup_system() {
Expand Down
10 changes: 5 additions & 5 deletions crates/bevy_dylib/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,21 @@
//!
//! ## The recommended way
//!
//! The easiest way to enable dynamic linking is to use the `--features bevy/dynamic` flag when
//! 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`
//! `cargo run --features bevy/dynamic_linking`
//!
//! ## The unrecommended way
//!
//! It is also possible to enable the `dynamic` feature inside of the `Cargo.toml` file. This is
//! 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` feature to the
//! To enable dynamic linking inside of the `Cargo.toml` file add the `dynamic_linking` feature to the
//! bevy dependency:
//!
//! `features = ["dynamic"]`
//! `features = ["dynamic_linking"]`
//!
//! ## The manual way
//!
Expand Down
4 changes: 2 additions & 2 deletions crates/bevy_internal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "bevy_internal"
version = "0.9.0"
edition = "2021"
description = "An internal Bevy crate used to facilitate optional dynamic linking via the 'dynamic' feature"
description = "An internal Bevy crate used to facilitate optional dynamic linking via the 'dynamic_linking' feature"
homepage = "https://bevyengine.org"
repository = "https://github.com/bevyengine/bevy"
license = "MIT OR Apache-2.0"
Expand Down Expand Up @@ -72,7 +72,7 @@ bevy_ci_testing = ["bevy_app/bevy_ci_testing", "bevy_render/ci_limits"]
animation = ["bevy_animation", "bevy_gltf?/bevy_animation"]

# Used to disable code that is unsupported when Bevy is dynamically linked
dynamic = ["bevy_diagnostic/dynamic"]
dynamic_linking = ["bevy_diagnostic/dynamic_linking"]

[dependencies]
# bevy
Expand Down
2 changes: 1 addition & 1 deletion docs/cargo_features.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
|feature name|description|
|-|-|
|bevy_dynamic_plugin|Plugin for dynamic loading (using [libloading](https://crates.io/crates/libloading)).|
|dynamic|Forces bevy to be dynamically linked, which improves iterative compile times.|
|dynamic_linking|Forces bevy to be dynamically linked, which improves iterative compile times.|
|trace|Enables system tracing.|
|trace_chrome|Enables [tracing-chrome](https://github.com/thoren-d/tracing-chrome) as bevy_log output. This allows you to visualize system execution.|
|trace_tracy|Enables [Tracy](https://github.com/wolfpld/tracy) as bevy_log output. This allows `Tracy` to connect to and capture profiling data as well as visualize system execution in real-time, present statistics about system execution times, and more.|
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@

pub use bevy_internal::*;

#[cfg(feature = "dynamic")]
#[cfg(feature = "dynamic_linking")]
#[allow(unused_imports)]
use bevy_dylib;

0 comments on commit 8efea1b

Please sign in to comment.