I have just started looking into the Bevy
game engine for Rust. It has a feature called dynamic
, which enables dynamic linking, to speed up compilation time during development. We are, however, advised to disable this when building for release.
Is there a way to tell Cargo to enable the dynamic
feature for a debug build, but disable it for a release build? Or do I have to personally remember to change bevy = { version = "0.5.0", features = ["dynamic"] }
to bevy = "0.5.0"
in Cargo.toml
before running cargo build --release
?
The rustc compiler has 4 optimization level, just like gcc.
toml which defaults to: Windows: %USERPROFILE%\. cargo\config. toml.
Along the lines of Rodrigo's comment, can confirm the following seems to work well:
[dependencies]
bevy = { version = "0.5.0" }
[features]
default = ["fast-compile"]
fast-compile = ["bevy/dynamic"]
Then for development, simply: cargo build
And for release: cargo build --release --no-default-features
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With