-
Notifications
You must be signed in to change notification settings - Fork 240
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
feat: Make it easier to specify target architecture #869
feat: Make it easier to specify target architecture #869
Conversation
Create aliases build-arm run-arm build-riscv and run-riscv in .cargo/config.toml. With these defined you can now use the alias which will be converted to the full target name: cargo build-arm -> cargo build --target thumbv8m.main-none-eabihf cargo run-arm -> cargo run --target thumbv8m.main-none-eabihf cargo build-riscv -> cargo build --target riscv32imac-unknown-none-elf cargo run-risv -> cargo run --target riscv32imac-unknown-none-elf Append --release parameter to do release builds and runs. For example: cargo run-riscv --release -> cargo run --target riscv32imac-unknown-none-elf --release feat: Make it easier to specify target architecture Create aliases build-arm run-arm build-riscv and run-riscv in .cargo/config.toml. With these defined you can now use the alias which will be converted to the full target name: cargo build-arm --bin blinky -> cargo build --bin blinky --target=thumbv8m.main-none-eabihf cargo run-arm --bin blinky -> cargo run --bin blinky --target=thumbv8m.main-none-eabihf cargo build-riscv --bin blinky -> cargo build --bin blinky --target=riscv32imac-unknown-none-elf cargo run-risv --bin blinky -> cargo run --bin blinky --target=riscv32imac-unknown-none-elf Append --release parameter to do release builds and runs. For example: cargo run-risv --bin blinky --release -> cargo run --bin blinky --target=thumbv8m.main-none-eabihf --release
Nice idea. Can you put these in the README too? |
Also, tweak the aliases and add dev and release modes with shorter names.
I'm not sure the extra aliases help with clarity. I was OK with the previous list of four: build-arm = "build --target=thumbv8m.main-none-eabihf"
run-arm = "run --target=thumbv8m.main-none-eabihf"
build-riscv = "build --target=riscv32imac-unknown-none-elf"
run-riscv = "run --target=riscv32imac-unknown-none-elf" Mainly because this saves you from typing the target name out in full. Users are welcome to configure their personal projects however they wish. However, this is example code and a lengthy explaination of the short-form custom aliases (like |
Makes sense, but how about adding Do you like the |
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.
Txs for the feed back!
I prefer build-xxx. I think |
SG
Do you want me to keep |
Delete that one - |
config.toml: * Use build-* rather than bld-* * Add a "custom" command example `rrr-blinky` README.md: * Show "all" examples are created if `--bin` is not specified * Show the size differential between development and release profiles * Describe aliases at the end of Getting Started using build-riscv, run-riscv and rrr-blinky
This is definitely heading in the right direction. Made a few suggestions. |
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.
LGTM, txs the final tweaks!!!!
Bravo, txs @9names and @thejpster for all the help and guidance! |
feat: Make it easier to specify target architecture
Create aliases build-arm run-arm build-riscv and run-riscv in .cargo/config.toml. With these defined you can now use the alias which will be converted to the full target name:
cargo build-arm --bin blinky ->
cargo build --bin blinky --target=thumbv8m.main-none-eabihf
cargo run-arm --bin blinky ->
cargo run --bin blinky --target=thumbv8m.main-none-eabihf
cargo build-riscv --bin blinky ->
cargo build --bin blinky --target=riscv32imac-unknown-none-elf
cargo run-risv --bin blinky ->
cargo run --bin blinky --target=riscv32imac-unknown-none-elf
Append --release parameter to do release builds and runs. For example:
cargo run-risv --bin blinky --release ->
cargo run --bin blinky --target=thumbv8m.main-none-eabihf --release