Skip to content

Commit

Permalink
Fix bugs in --clang-macro-fallback
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jbaublitz committed Jan 8, 2025
1 parent 59a43e1 commit 3542257
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions bindgen/ir/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
);
Expand All @@ -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(),
);
Expand Down

0 comments on commit 3542257

Please sign in to comment.