-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for cargo
's --config
arg
#209
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works like a charm! Tested with config options as arguments or by passing a file.
If the comment about the cargo build
options is resolved this can be merged IMO 😊
Perhaps a test case for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work!
Objective
Closes #201.
Allows users to quickly try out different configurations without modifying
Cargo.toml
.For us, it's most useful for finding the best default config for the web profiles.
Solution
Add support for
--config
argument forbevy build
andbevy run
, analogue to thecargo
counterpart.This essentially allows you to modify the
Cargo.toml
without editing the file, e.g.--config "profile.web.debug=false"
.We already exploit
cargo
's--config
arg to configure our default web compilation profiles.So we have to ensure that the user-provided args overwrite our default ones.
To do this, we change the default web profiles to be prepended to the user-provided
--config
args, instead of converting them to--config
arguments directly.Since
--config
is resolved left-to-right, the defaults will be overwritten by the user.Testing
Try for example:
Now instead of
you should get
Debug info removed and optimizations enabled!
(Of course this can be done easier via
bevy build --release web
, but like this it's easier to benchmark different compilation profiles to choose the best default)