I’m looking to get the complete list of source (ie module and
include*!) files used to build a particular target. At the moment,
cargo metadata only includes the top-level source file.
rustc has the
--emit deps-info option, and which cargo uses when it invokes rustc. But I couldn’t see a way to access that information (it wasn’t actually obvious to me that it uses it).
Is there some existing extension which provides this information? Or alternatively, would it make sense to extend the metadata json to include it? Or is there some fundamental reason why this wouldn’t work?
(Background: my goal is to write a tool which can take a Cargo.toml and generate build rules for a different build system, which needs all input files to be explicitly listed.)