Skip to content

Commit 50b3f27

Browse files
author
KDecay
committed
Updated bevy_dylib documentation and added missing_doc warning. (#3515)
This PR is part of the issue #3492. # Objective - Add and update the bevy_dylib documentation to achieve a 100% documentation coverage. - Add the #![warn(missing_docs)] lint to keep the documentation coverage for the future. # Solution - Add and update the bevy_dylib documentation. - Add the #![warn(missing_docs)] lint.
1 parent 478bf7a commit 50b3f27

File tree

1 file changed

+47
-5
lines changed

1 file changed

+47
-5
lines changed

crates/bevy_dylib/src/lib.rs

+47-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,54 @@
1+
#![warn(missing_docs)]
12
#![allow(clippy::single_component_path_imports)]
23

34
//! Forces dynamic linking of Bevy.
45
//!
5-
//! Dynamically linking Bevy makes the "link" step much faster. This can be achieved by adding
6-
//! `bevy_dylib` as dependency and `#[allow(unused_imports)] use bevy_dylib` to `main.rs`. It is
7-
//! recommended to disable the `bevy_dylib` dependency in release mode by adding
8-
//! `#[cfg(debug_assertions)]` to the `use` statement. Otherwise you will have to ship `libstd.so`
9-
//! and `libbevy_dylib.so` with your game.
6+
//! Dynamic linking causes Bevy to be built and linked as a dynamic library. This will make
7+
//! incremental builds compile much faster.
8+
//!
9+
//! # Warning
10+
//!
11+
//! Do not enable this feature for release builds because this would require you to ship
12+
//! `libstd.so` and `libbevy_dylib.so` with your game.
13+
//!
14+
//! # Enabling dynamic linking
15+
//!
16+
//! ## The recommended way
17+
//!
18+
//! The easiest way to enable dynamic linking is to use the `--features bevy/dynamic` flag when
19+
//! using the `cargo run` command:
20+
//!
21+
//! `cargo run --features bevy/dynamic`
22+
//!
23+
//! ## The unrecommended way
24+
//!
25+
//! It is also possible to enable the `dynamic` feature inside of the `Cargo.toml` file. This is
26+
//! unrecommended because it requires you to remove this feature every time you want to create a
27+
//! release build to avoid having to ship additional files with your game.
28+
//!
29+
//! To enable dynamic linking inside of the `Cargo.toml` file add the `dynamic` feature to the
30+
//! bevy dependency:
31+
//!
32+
//! `features = ["dynamic"]`
33+
//!
34+
//! ## The manual way
35+
//!
36+
//! Manually enabling dynamic linking is achieved by adding `bevy_dylib` as a dependency and
37+
//! adding the following code to the `main.rs` file:
38+
//!
39+
//! ```rust
40+
//! #[allow(unused_imports)]
41+
//! use bevy_dylib;
42+
//! ```
43+
//!
44+
//! It is recommended to disable the `bevy_dylib` dependency in release mode by adding the
45+
//! following code to the `use` statement to avoid having to ship additional files with your game:
46+
//!
47+
//! ```rust
48+
//! #[allow(unused_imports)]
49+
//! #[cfg(debug_assertions)] // new
50+
//! use bevy_dylib;
51+
//! ```
1052
1153
// Force linking of the main bevy crate
1254
#[allow(unused_imports)]

0 commit comments

Comments
 (0)