rust-embedded / cortex-m-quickstart

Template to develop bare metal applications for Cortex-M microcontrollers
782 stars 164 forks source link

Move link-arg setting from .cargo/config.toml to build.rs #118

Closed adamgreig closed 1 year ago

adamgreig commented 1 year ago

It's easy to forget about the hidden .cargo/config.toml file, and setting the linker flags in build.rs also means they can be changed without requiring a rebuild of everything, they are more robust to running the build from a location where .cargo/config.toml isn't picked up, and they make it easier to support different linker arguments for different crates or binaries.

Thanks to @Dirbaio for the suggestion!