Closed gzz2000 closed 7 months ago
Thank you!
I am also wondering if adding a compile_commands.json-generator directly into cc-rs might be useful
I think that is a bit too much, cc is often used in build.rs, so it should strive to be as simple/small as possible.
I think it's better to write another crate generating compile_command.json
, given the API in this PR should be enough for a third-party crate to use it directly or indirectly.
Thank you very much!
Hi, I am adding a public interface for iterating the files to be compiled. My use case is to generate
compile_commands.json
outside. This configuration is needed by various language servers/IDEs and contains the mapping between source files and their compile commands. We can already get the compile commands usingget_compiler
, but the files are not exposed through any public interface yet. I've made this interface a little more general by not exposingArc<Path>
but give an iterator instead.I am also wondering if adding a
compile_commands.json
-generator directly intocc-rs
might be useful as this is a built-in feature for many build systems including cmake, bazel, makefile, ninja, and some rust ones etc. It is better if one can generate one json combined from multiplecc::Build
instances.