commit | b5f05fbb0869ab2833e8b843f6c75c32931c4e67 | [log] [tgz] |
---|---|---|
author | Eli Lipsitz <elipsitz@google.com> | Wed Feb 01 00:01:36 2023 +0000 |
committer | CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com> | Wed Feb 01 00:01:36 2023 +0000 |
tree | 5b7e54cf218e794794d27032bd6d921b7916fbdc | |
parent | 3865a74f02bb4983ae3fc9b0398b7c6c70dc32d5 [diff] |
pw_rust: Make rust_bin tool definition more robust The existing rust_bin tool definition in the generate_toolchain template is missing a few critical pieces: 1) depfile generation -- without this, Ninja won't recompile Rust targets when a module (rather than the main.rs or lib.rs) changes. 2) Unused GN rust_bin toolchain arguments. rustenv, crate_name, crate_type, rustflags, rustdeps, externs all are provided by GN for Rust targets and are necessary to get proper compilation, dependencies, flags, etc. This commit adds the missing pieces. The depfile arguments to rustc look a little bit arbitrary, but they're just what's required to get rustc to output depfiles that Ninja can understand (borrowed from Fuchsia). Tested: Set some rustflags in a target, verified they're set properly. Added a Rust target that depends on a module in another file, verified that without this change, changes to that module do not cause a rebuild, and after this change, they do. Change-Id: Ifc4cd5a4d099fada960dae9e0b663c47bd51cec2 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/127013 Reviewed-by: Erik Gilling <konkers@google.com> Commit-Queue: Eli Lipsitz <elipsitz@google.com>
Pigweed is an open source collection of embedded-targeted libraries–or as we like to call them, modules. These modules are building blocks and infrastructure that enable faster and more reliable development on small-footprint MMU-less 32-bit microcontrollers like the STMicroelectronics STM32L452 or the Nordic nRF52832.
For more information please see our website: https://pigweed.dev/.