File tree 1 file changed +10
-5
lines changed 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -199,11 +199,16 @@ pub fn main() {
199
199
bind_args. push ( "--" . to_owned ( ) ) ;
200
200
}
201
201
202
- // TODO: distinguish C and C++ paths? C++'s should be enough, I guess.
203
- for path in clang. cpp_search_paths . into_iter ( ) {
204
- if let Ok ( path) = path. into_os_string ( ) . into_string ( ) {
205
- bind_args. push ( "-isystem" . to_owned ( ) ) ;
206
- bind_args. push ( path) ;
202
+ // If --target is specified, assume caller knows what they're doing and don't mess with
203
+ // include paths for them
204
+ let has_target_arg = bind_args. iter ( ) . rposition ( |arg| arg. starts_with ( "--target" ) ) . is_some ( ) ;
205
+ if !has_target_arg {
206
+ // TODO: distinguish C and C++ paths? C++'s should be enough, I guess.
207
+ for path in clang. cpp_search_paths . into_iter ( ) {
208
+ if let Ok ( path) = path. into_os_string ( ) . into_string ( ) {
209
+ bind_args. push ( "-isystem" . to_owned ( ) ) ;
210
+ bind_args. push ( path) ;
211
+ }
207
212
}
208
213
}
209
214
}
You can’t perform that action at this time.
0 commit comments