Skip to content

Commit

Permalink
added a function to remove flags
Browse files Browse the repository at this point in the history
  • Loading branch information
raisfeld-ori authored Oct 7, 2023
1 parent 2447a2b commit a600072
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,21 @@ impl Build {
self
}

/// removes a compiler flag that was added by [`Build::flag`]
///
/// # Example
/// ```
/// cc::Build::new()
/// .file("src/foo.c")
/// .flag("unwanted_flag")
/// .remove_flag("unwanted_flag");
/// ```
pub fn remove_flag(&mut self, flag: &str) -> &mut Build {
self.flags.retain(|other_flag| &**other_flag != flag);
self
}

/// Add a flag to the invocation of the ar
///
/// # Example
Expand Down

0 comments on commit a600072

Please sign in to comment.