diff options
author | Vladimir Vukicevic <vladimir@pobox.com> | 2016-09-07 23:44:43 -0400 |
---|---|---|
committer | Vladimir Vukicevic <vladimir@pobox.com> | 2016-09-07 23:44:43 -0400 |
commit | 120dacb84e7db568560e381aeec931aa13c680f8 (patch) | |
tree | 2b37b60bce998847536199a8e23aafdee3de04f7 | |
parent | c97ac0516725cc838944157f15e61319d6ef0d31 (diff) |
Don't add -isystem header args when --target is specified
-rwxr-xr-x | src/bin/bindgen.rs | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/bin/bindgen.rs b/src/bin/bindgen.rs index 4ea2cd91..8c515131 100755 --- a/src/bin/bindgen.rs +++ b/src/bin/bindgen.rs @@ -199,11 +199,16 @@ pub fn main() { bind_args.push("--".to_owned()); } - // TODO: distinguish C and C++ paths? C++'s should be enough, I guess. - for path in clang.cpp_search_paths.into_iter() { - if let Ok(path) = path.into_os_string().into_string() { - bind_args.push("-isystem".to_owned()); - bind_args.push(path); + // If --target is specified, assume caller knows what they're doing and don't mess with + // include paths for them + let has_target_arg = bind_args.iter().rposition(|arg| arg.starts_with("--target")).is_some(); + if !has_target_arg { + // TODO: distinguish C and C++ paths? C++'s should be enough, I guess. + for path in clang.cpp_search_paths.into_iter() { + if let Ok(path) = path.into_os_string().into_string() { + bind_args.push("-isystem".to_owned()); + bind_args.push(path); + } } } } |