@@ -235,11 +235,11 @@ impl Builder {
235
235
if !self . options . whitelist_recursively {
236
236
output_vector. push ( "--no-recursive-whitelist" . into ( ) ) ;
237
237
}
238
-
238
+
239
239
if self . options . objc_extern_crate {
240
240
output_vector. push ( "--objc-extern-crate" . into ( ) ) ;
241
241
}
242
-
242
+
243
243
if self . options . builtins {
244
244
output_vector. push ( "--builtins" . into ( ) ) ;
245
245
}
@@ -249,15 +249,6 @@ impl Builder {
249
249
output_vector. push ( prefix. clone ( ) ) ;
250
250
}
251
251
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
-
261
252
if let Some ( ref dummy) = self . options . dummy_uses {
262
253
output_vector. push ( "--dummy-uses" . into ( ) ) ;
263
254
output_vector. push ( dummy. clone ( ) ) ;
@@ -316,7 +307,7 @@ impl Builder {
316
307
if self . options . codegen_config . destructors {
317
308
options. push ( "destructors" . into ( ) ) ;
318
309
}
319
-
310
+
320
311
output_vector. push ( options. join ( "," ) ) ;
321
312
322
313
if !self . options . codegen_config . methods {
@@ -410,6 +401,18 @@ impl Builder {
410
401
} )
411
402
. count ( ) ;
412
403
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
+
413
416
output_vector
414
417
}
415
418
@@ -1243,7 +1246,7 @@ fn commandline_flag_unit_test_function() {
1243
1246
1244
1247
assert ! ( test_cases. iter( ) . all( |ref x| command_line_flags. contains( x) ) ) ;
1245
1248
1246
- //Test 2
1249
+ //Test 2
1247
1250
let bindings = :: builder ( ) . header ( "input_header" )
1248
1251
. whitelisted_type ( "Distinct_Type" )
1249
1252
. whitelisted_function ( "safe_function" ) ;
0 commit comments