diff options
author | Adam Perry <adamperry@google.com> | 2021-04-08 17:26:55 +0000 |
---|---|---|
committer | Emilio Cobos Álvarez <emilio@crisal.io> | 2021-04-24 00:51:44 +0200 |
commit | 1bb548b7a7c482e9851af9864a9736faee48a10b (patch) | |
tree | a285a423eed77ab7b667dc8e2bdfd1bf312c3c8d /src/codegen/mod.rs | |
parent | c39c47c2e5a3839ab57dec0d585b7e6af60416f6 (diff) |
Support emitting Makefile-syntax depfiles like gcc/clang/rustc.
Needed to auto-bindgen with a ninja build without the build graph
going stale.
Diffstat (limited to 'src/codegen/mod.rs')
-rw-r--r-- | src/codegen/mod.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/codegen/mod.rs b/src/codegen/mod.rs index e498d2b2..1a702b00 100644 --- a/src/codegen/mod.rs +++ b/src/codegen/mod.rs @@ -4207,6 +4207,16 @@ pub(crate) fn codegen( } } + if let Some(spec) = context.options().depfile.as_ref() { + match spec.write(context.deps()) { + Ok(()) => info!( + "Your depfile was generated successfully into: {}", + spec.depfile_path.display() + ), + Err(e) => warn!("{}", e), + } + } + context.resolve_item(context.root_module()).codegen( context, &mut result, |