Skip to content

Commit

Permalink
Merge pull request #7 from polachok/flags
Browse files Browse the repository at this point in the history
Allow user-specified flags override default
  • Loading branch information
alexcrichton committed Apr 15, 2016
2 parents 965d657 + ff477ba commit a6becb6
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 a6becb6

Please sign in to comment.