Skip to content

Commit 7867787

Browse files
author
Aatif Syed
committed
add Builder functions for including folder(s) and headers
1 parent e2f0c0b commit 7867787

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

src/lib.rs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -648,6 +648,33 @@ impl Builder {
648648
self
649649
}
650650

651+
/// Add multiple input C/C++ headers.
652+
pub fn headers<T: AsRef<str>>(
653+
mut self,
654+
headers: impl IntoIterator<Item = T>,
655+
) -> Builder {
656+
for path in headers {
657+
self = self.header(path.as_ref());
658+
}
659+
self
660+
}
661+
662+
/// Include a folder for system header file resolution
663+
pub fn include(self, path: impl AsRef<str>) -> Builder {
664+
self.clang_arg(format!("-I{}", path.as_ref()))
665+
}
666+
667+
/// Include multiple folders for system header file resolution
668+
pub fn includes<T: AsRef<str>>(
669+
mut self,
670+
paths: impl IntoIterator<Item = T>,
671+
) -> Builder {
672+
for path in paths {
673+
self = self.include(path);
674+
}
675+
self
676+
}
677+
651678
/// Add a depfile output which will be written alongside the generated bindings.
652679
pub fn depfile<H: Into<String>, D: Into<PathBuf>>(
653680
mut self,

0 commit comments

Comments
 (0)