From 35422574f72389b429742e77c8aae3c21d605156 Mon Sep 17 00:00:00 2001 From: John Baublitz Date: Wed, 8 Jan 2025 11:04:49 -0500 Subject: [PATCH] Fix bugs in --clang-macro-fallback This commit resolves a bug where -include was not respected and a bug where -MMD was passed to the fallback translation unit which would cause the dependency file to be overwritten with useless information about temporary files. --- bindgen/ir/context.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bindgen/ir/context.rs b/bindgen/ir/context.rs index 098dd25e59..aa06cdc915 100644 --- a/bindgen/ir/context.rs +++ b/bindgen/ir/context.rs @@ -2104,7 +2104,8 @@ If you encounter an error missing from this list, please file an issue or a PR!" .iter() .filter(|next| { !self.options.input_headers.contains(next) && - next.as_ref() != "-include" + !next.contains("-MD") && + !next.contains("-MMD") }) .cloned(), ); @@ -2124,11 +2125,11 @@ If you encounter an error missing from this list, please file an issue or a PR!" c_args.extend( self.options .clang_args - .clone() .iter() .filter(|next| { !self.options.input_headers.contains(next) && - next.as_ref() != "-include" + !next.contains("-MD") && + !next.contains("-MMD") }) .cloned(), );