NiklasEi / bevy_game_template

Template for a Bevy game including CI/CD for web, Windows, Linux, macOS, iOS and Android
https://niklasei.github.io/bevy_game_template/
Creative Commons Zero v1.0 Universal
844 stars 89 forks source link

LTO options in release and dist profiles are swapped #89

Closed rparrett closed 11 months ago

rparrett commented 11 months ago

These are the profiles as they currently exist.

[profile.release]
lto = true
codegen-units = 1

# The profile that 'cargo dist' will build with
[profile.dist]
inherits = "release"
lto = "thin"

The parts below produce potentially better optimizations at the cost of speed. (vs thin and default codegen units)

lto = true
codegen-units = 1

I believe they should be in the dist profile, not release.

IMO, LTO shouldn't be used at all in release, but I am impatient.

NiklasEi commented 11 months ago

Hey, thanks for the reminder. I tried to clean this up and was hoping I could remove the custom release configuration, but some of the tools the template uses for distribution builds do not support custom profiles (xbuild and trunk).

I improved the dist profile, used it were I could and documented why the release profile still has custom configuration. As soon as all used build tools support custom profiles, I would like to remove the release configuration.