We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4c0062d commit bb1220dCopy full SHA for bb1220d
src/lib.rs
@@ -431,6 +431,24 @@ impl Build {
431
self
432
}
433
434
+ /// Removes a compiler flag that was added by [`Build::flag`].
435
+ ///
436
+ /// Will not remove flags added by other means (default flags,
437
+ /// flags from env, and so on).
438
439
+ /// # Example
440
+ /// ```
441
+ /// cc::Build::new()
442
+ /// .file("src/foo.c")
443
+ /// .flag("unwanted_flag")
444
+ /// .remove_flag("unwanted_flag");
445
446
+
447
+ pub fn remove_flag(&mut self, flag: &str) -> &mut Build {
448
+ self.flags.retain(|other_flag| &**other_flag != flag);
449
+ self
450
+ }
451
452
/// Add a flag to the invocation of the ar
453
///
454
/// # Example
0 commit comments