Skip to content

Commit 1248ed8

Browse files
committed
Merge pull request rust-lang#243 from abbradar/include-path
Add bundled Clang includes in default options
2 parents aab8618 + 0e8d0c6 commit 1248ed8

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

src/bin/bindgen.rs

-8
Original file line numberDiff line numberDiff line change
@@ -162,14 +162,6 @@ pub fn main() {
162162
let mut bind_args: Vec<_> = env::args().collect();
163163
let bin = bind_args.remove(0);
164164

165-
match bindgen::get_include_dir() {
166-
Some(path) => {
167-
bind_args.push("-I".to_owned());
168-
bind_args.push(path);
169-
}
170-
None => (),
171-
}
172-
173165
match parse_args(&bind_args[..]) {
174166
ParseResult::ParseErr(e) => panic!(e),
175167
ParseResult::CmdUsage => print_usage(bin),

src/lib.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,10 @@ impl Default for BindgenOptions {
116116
emit_ast: false,
117117
fail_on_unknown_type: false,
118118
override_enum_ty: "".to_string(),
119-
clang_args: Vec::new()
119+
clang_args: match get_include_dir() {
120+
Some(path) => vec!("-idirafter".to_owned(), path),
121+
None => Vec::new()
122+
}
120123
}
121124
}
122125
}

0 commit comments

Comments
 (0)