From 1bb548b7a7c482e9851af9864a9736faee48a10b Mon Sep 17 00:00:00 2001 From: Adam Perry Date: Thu, 8 Apr 2021 17:26:55 +0000 Subject: Support emitting Makefile-syntax depfiles like gcc/clang/rustc. Needed to auto-bindgen with a ninja build without the build graph going stale. --- src/codegen/mod.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/codegen/mod.rs') 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, -- cgit v1.2.3