Skip to content

Commit a36c09b

Browse files
committed
Fix the command line flags dumper for clang args
...and trailing whitespace.
1 parent 76cc088 commit a36c09b

File tree

1 file changed

+16
-13
lines changed

1 file changed

+16
-13
lines changed

src/lib.rs

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -235,11 +235,11 @@ impl Builder {
235235
if !self.options.whitelist_recursively {
236236
output_vector.push("--no-recursive-whitelist".into());
237237
}
238-
238+
239239
if self.options.objc_extern_crate {
240240
output_vector.push("--objc-extern-crate".into());
241241
}
242-
242+
243243
if self.options.builtins {
244244
output_vector.push("--builtins".into());
245245
}
@@ -249,15 +249,6 @@ impl Builder {
249249
output_vector.push(prefix.clone());
250250
}
251251

252-
self.options
253-
.clang_args
254-
.iter()
255-
.map(|item| {
256-
output_vector.push("--clang-args".into());
257-
output_vector.push(item.trim_left_matches("^").trim_right_matches("$").into());
258-
})
259-
.count();
260-
261252
if let Some(ref dummy) = self.options.dummy_uses {
262253
output_vector.push("--dummy-uses".into());
263254
output_vector.push(dummy.clone());
@@ -316,7 +307,7 @@ impl Builder {
316307
if self.options.codegen_config.destructors {
317308
options.push("destructors".into());
318309
}
319-
310+
320311
output_vector.push(options.join(","));
321312

322313
if !self.options.codegen_config.methods {
@@ -410,6 +401,18 @@ impl Builder {
410401
})
411402
.count();
412403

404+
if !self.options.clang_args.is_empty() {
405+
output_vector.push("--".into());
406+
self.options
407+
.clang_args
408+
.iter()
409+
.cloned()
410+
.map(|item| {
411+
output_vector.push(item);
412+
})
413+
.count();
414+
}
415+
413416
output_vector
414417
}
415418

@@ -1243,7 +1246,7 @@ fn commandline_flag_unit_test_function() {
12431246

12441247
assert!(test_cases.iter().all(|ref x| command_line_flags.contains(x)) );
12451248

1246-
//Test 2
1249+
//Test 2
12471250
let bindings = ::builder().header("input_header")
12481251
.whitelisted_type("Distinct_Type")
12491252
.whitelisted_function("safe_function");

0 commit comments

Comments
 (0)