Skip to content

Commit 4ea3ce3

Browse files
committed
Fix the command line flags dumper for clang args
...and trailing whitespace.
1 parent 3f5975e commit 4ea3ce3

File tree

1 file changed

+17
-14
lines changed

1 file changed

+17
-14
lines changed

src/lib.rs

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -231,11 +231,11 @@ impl Builder {
231231
if self.options.whitelist_recursively == false {
232232
output_vector.push("--no-recursive-whitelist".into());
233233
}
234-
234+
235235
if self.options.objc_extern_crate == true {
236236
output_vector.push("--objc-extern-crate".into());
237237
}
238-
238+
239239
if self.options.builtins == true {
240240
output_vector.push("--builtins".into());
241241
}
@@ -245,15 +245,6 @@ impl Builder {
245245
output_vector.push(prefix.clone());
246246
}
247247

248-
self.options
249-
.clang_args
250-
.iter()
251-
.map(|item| {
252-
output_vector.push("--clang-args".into());
253-
output_vector.push(item.trim_left_matches("^").trim_right_matches("$").into());
254-
})
255-
.count();
256-
257248
if let Some(ref dummy) = self.options.dummy_uses {
258249
output_vector.push("--dummy-uses".into());
259250
output_vector.push(dummy.clone());
@@ -312,7 +303,7 @@ impl Builder {
312303
if self.options.codegen_config.destructors == true {
313304
options.push("destructors".into());
314305
}
315-
306+
316307
output_vector.push(options.join(","));
317308

318309
if self.options.codegen_config.methods == false{
@@ -406,6 +397,18 @@ impl Builder {
406397
})
407398
.count();
408399

400+
if !self.options.clang_args.is_empty() {
401+
output_vector.push("--".into());
402+
self.options
403+
.clang_args
404+
.iter()
405+
.cloned()
406+
.map(|item| {
407+
output_vector.push(item);
408+
})
409+
.count();
410+
}
411+
409412
output_vector
410413
}
411414

@@ -1219,7 +1222,7 @@ fn commandline_flag_unit_test_function() {
12191222

12201223
assert!(test_cases.iter().all(|ref x| command_line_flags.contains(x)) );
12211224

1222-
//Test 2
1225+
//Test 2
12231226
let bindings = ::builder().header("input_header")
12241227
.whitelisted_type("Distinct_Type")
12251228
.whitelisted_function("safe_function");
@@ -1237,4 +1240,4 @@ fn commandline_flag_unit_test_function() {
12371240

12381241
assert!(test_cases.iter().all(|ref x| command_line_flags.contains(x)) );
12391242

1240-
}
1243+
}

0 commit comments

Comments
 (0)