File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -337,6 +337,35 @@ impl Build {
337337 self
338338 }
339339
340+ /// Add multiple directories to the `-I` include path.
341+ ///
342+ /// # Example
343+ ///
344+ /// ```no_run
345+ /// # use std::path::Path;
346+ /// # let condition = true;
347+ /// #
348+ /// let mut extra_dir = None;
349+ /// if condition {
350+ /// extra_dir = Some(Path::new("/path/to"));
351+ /// }
352+ ///
353+ /// cc::Build::new()
354+ /// .file("src/foo.c")
355+ /// .includes(extra_dir)
356+ /// .compile("foo");
357+ /// ```
358+ pub fn includes < P > ( & mut self , dirs : P ) -> & mut Build
359+ where
360+ P : IntoIterator ,
361+ P :: Item : AsRef < Path > ,
362+ {
363+ for dir in dirs {
364+ self . include ( dir) ;
365+ }
366+ self
367+ }
368+
340369 /// Specify a `-D` variable with an optional value.
341370 ///
342371 /// # Example
You can’t perform that action at this time.
0 commit comments