@@ -231,11 +231,11 @@ impl Builder {
231
231
if self . options . whitelist_recursively == false {
232
232
output_vector. push ( "--no-recursive-whitelist" . into ( ) ) ;
233
233
}
234
-
234
+
235
235
if self . options . objc_extern_crate == true {
236
236
output_vector. push ( "--objc-extern-crate" . into ( ) ) ;
237
237
}
238
-
238
+
239
239
if self . options . builtins == true {
240
240
output_vector. push ( "--builtins" . into ( ) ) ;
241
241
}
@@ -245,15 +245,6 @@ impl Builder {
245
245
output_vector. push ( prefix. clone ( ) ) ;
246
246
}
247
247
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
-
257
248
if let Some ( ref dummy) = self . options . dummy_uses {
258
249
output_vector. push ( "--dummy-uses" . into ( ) ) ;
259
250
output_vector. push ( dummy. clone ( ) ) ;
@@ -312,7 +303,7 @@ impl Builder {
312
303
if self . options . codegen_config . destructors == true {
313
304
options. push ( "destructors" . into ( ) ) ;
314
305
}
315
-
306
+
316
307
output_vector. push ( options. join ( "," ) ) ;
317
308
318
309
if self . options . codegen_config . methods == false {
@@ -406,6 +397,18 @@ impl Builder {
406
397
} )
407
398
. count ( ) ;
408
399
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
+
409
412
output_vector
410
413
}
411
414
@@ -1219,7 +1222,7 @@ fn commandline_flag_unit_test_function() {
1219
1222
1220
1223
assert ! ( test_cases. iter( ) . all( |ref x| command_line_flags. contains( x) ) ) ;
1221
1224
1222
- //Test 2
1225
+ //Test 2
1223
1226
let bindings = :: builder ( ) . header ( "input_header" )
1224
1227
. whitelisted_type ( "Distinct_Type" )
1225
1228
. whitelisted_function ( "safe_function" ) ;
@@ -1237,4 +1240,4 @@ fn commandline_flag_unit_test_function() {
1237
1240
1238
1241
assert ! ( test_cases. iter( ) . all( |ref x| command_line_flags. contains( x) ) ) ;
1239
1242
1240
- }
1243
+ }
0 commit comments