diff options
author | Travis Finkenauer <tmfinken@gmail.com> | 2020-06-27 01:41:35 -0400 |
---|---|---|
committer | Emilio Cobos Álvarez <emilio@crisal.io> | 2020-06-29 02:48:11 +0200 |
commit | 01b1418800de854e6c73be69851fd9d2129dc642 (patch) | |
tree | e788a8e4c9b9d1bfdc0a62fa87b09e8e354ebbcc | |
parent | 939959a7dffe5e4d91fc7525bc49c1e1ab805c51 (diff) |
Output clang args after '--'
For command_line_flags(), some arguments (like '--no-record-matches')
were added after '--'. The bindgen program would interpret these as
clang args.
-rw-r--r-- | src/lib.rs | 30 |
1 files changed, 16 insertions, 14 deletions
@@ -593,20 +593,6 @@ impl Builder { }) .count(); - output_vector.push("--".into()); - - if !self.options.clang_args.is_empty() { - output_vector.extend(self.options.clang_args.iter().cloned()); - } - - if self.input_headers.len() > 1 { - output_vector.extend( - self.input_headers[..self.input_headers.len() - 1] - .iter() - .cloned(), - ); - } - if !self.options.record_matches { output_vector.push("--no-record-matches".into()); } @@ -659,6 +645,22 @@ impl Builder { }) .count(); + // Add clang arguments + + output_vector.push("--".into()); + + if !self.options.clang_args.is_empty() { + output_vector.extend(self.options.clang_args.iter().cloned()); + } + + if self.input_headers.len() > 1 { + output_vector.extend( + self.input_headers[..self.input_headers.len() - 1] + .iter() + .cloned(), + ); + } + output_vector } |