File tree 2 files changed +19
-25
lines changed 2 files changed +19
-25
lines changed Original file line number Diff line number Diff line change @@ -42,31 +42,6 @@ pub fn main() {
42
42
_ => { }
43
43
}
44
44
45
- if let Some ( clang) = clang_sys:: support:: Clang :: find ( None ) {
46
- let has_clang_args =
47
- bind_args. iter ( ) . rposition ( |arg| * arg == "--" ) . is_some ( ) ;
48
- if !has_clang_args {
49
- bind_args. push ( "--" . to_owned ( ) ) ;
50
- }
51
-
52
- // If --target is specified, assume caller knows what they're doing and
53
- // don't mess with
54
- // include paths for them
55
- let has_target_arg = bind_args. iter ( )
56
- . rposition ( |arg| arg. starts_with ( "--target" ) )
57
- . is_some ( ) ;
58
- if !has_target_arg {
59
- // TODO: distinguish C and C++ paths? C++'s should be enough, I
60
- // guess.
61
- for path in clang. cpp_search_paths . into_iter ( ) {
62
- if let Ok ( path) = path. into_os_string ( ) . into_string ( ) {
63
- bind_args. push ( "-isystem" . to_owned ( ) ) ;
64
- bind_args. push ( path) ;
65
- }
66
- }
67
- }
68
- }
69
-
70
45
match builder_from_flags ( bind_args. into_iter ( ) ) {
71
46
Ok ( ( builder, output) ) => {
72
47
let mut bindings = builder. generate ( )
Original file line number Diff line number Diff line change @@ -509,6 +509,25 @@ impl<'ctx> Bindings<'ctx> {
509
509
-> Result < Bindings < ' ctx > , ( ) > {
510
510
let span = span. unwrap_or ( DUMMY_SP ) ;
511
511
512
+ // TODO: Make this path fixup configurable?
513
+ if let Some ( clang) = clang_sys:: support:: Clang :: find ( None ) {
514
+ // If --target is specified, assume caller knows what they're doing
515
+ // and don't mess with include paths for them
516
+ let has_target_arg = options. clang_args . iter ( )
517
+ . rposition ( |arg| arg. starts_with ( "--target" ) )
518
+ . is_some ( ) ;
519
+ if !has_target_arg {
520
+ // TODO: distinguish C and C++ paths? C++'s should be enough, I
521
+ // guess.
522
+ for path in clang. cpp_search_paths . into_iter ( ) {
523
+ if let Ok ( path) = path. into_os_string ( ) . into_string ( ) {
524
+ options. clang_args . push ( "-isystem" . to_owned ( ) ) ;
525
+ options. clang_args . push ( path) ;
526
+ }
527
+ }
528
+ }
529
+ }
530
+
512
531
if let Some ( h) = options. input_header . as_ref ( ) {
513
532
options. clang_args . push ( h. clone ( ) )
514
533
}
You can’t perform that action at this time.
0 commit comments