Skip to content

Commit

Permalink
Allow user-specified flags override default
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Polyakov committed Apr 14, 2016
1 parent 965d657 commit ff477ba
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -559,10 +559,6 @@ impl TestGenerator {
// Compile our C shim to be linked into tests
let mut cfg = gcc::Config::new();
cfg.file(&out.with_extension("c"));
for flag in self.flags.iter() {
cfg.flag(flag);
}

if target.contains("msvc") {
cfg.flag("/W3").flag("/Wall").flag("/WX")
// ignored warnings
Expand All @@ -578,6 +574,11 @@ impl TestGenerator {
.flag("-Wno-unused-parameter")
.flag("-Wno-type-limits");
}

for flag in self.flags.iter() {
cfg.flag(flag);
}

for &(ref a, ref b) in self.defines.iter() {
cfg.define(a, b.as_ref().map(|s| &s[..]));
}
Expand Down

0 comments on commit ff477ba

Please sign in to comment.