@@ -658,11 +658,64 @@ impl Builder {
658
658
/// .generate()
659
659
/// .unwrap();
660
660
/// ```
661
+ ///
662
+ /// Prefer to use the [Builder::headers] method.
663
+ #[ doc( hidden) ]
661
664
pub fn header < T : Into < String > > ( mut self , header : T ) -> Builder {
662
665
self . options . input_headers . push ( header. into ( ) ) ;
663
666
self
664
667
}
665
668
669
+ /// Add input C/C++ headers to generate bindings for.
670
+ ///
671
+ /// This can be used to generate bindings to a single header:
672
+ ///
673
+ /// ```ignore
674
+ /// let bindings = bindgen::Builder::default()
675
+ /// .headers(["input.h"])
676
+ /// .generate()
677
+ /// .unwrap();
678
+ /// ```
679
+ ///
680
+ /// Or to multiple headers:
681
+ /// ```
682
+ /// bindgen::Builder::default()
683
+ /// .headers([
684
+ /// "input1.h",
685
+ /// "input2.h"
686
+ /// ])
687
+ /// // ...
688
+ /// # ;
689
+ /// ```
690
+ pub fn headers < T : Into < String > > (
691
+ mut self ,
692
+ headers : impl IntoIterator < Item = T > ,
693
+ ) -> Builder {
694
+ self . options
695
+ . input_headers
696
+ . extend ( headers. into_iter ( ) . map ( Into :: into) ) ;
697
+ self
698
+ }
699
+
700
+ /// Include multiple folders for system header file resolution.
701
+ ///
702
+ /// To add only a single file, use an array of length 1
703
+ /// ```
704
+ /// bindgen::Builder::default()
705
+ /// .include_directories(["/usr/lib/include/"])
706
+ /// // ...
707
+ /// # ;
708
+ /// ```
709
+ pub fn include_directories < T : Into < String > > (
710
+ mut self ,
711
+ paths : impl IntoIterator < Item = T > ,
712
+ ) -> Builder {
713
+ for path in paths {
714
+ self = self . clang_arg ( format ! ( "-I{}" , path. into( ) ) ) ;
715
+ }
716
+ self
717
+ }
718
+
666
719
/// Add a depfile output which will be written alongside the generated bindings.
667
720
pub fn depfile < H : Into < String > , D : Into < PathBuf > > (
668
721
mut self ,
0 commit comments