diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2017-08-06 13:40:12 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2017-08-06 13:40:12 +0200 |
commit | c6b7919ba8ba1d337574671cadd6635f6267dc54 (patch) | |
tree | f325601e96ee0b8493108c9a3301b519d11e4b2d | |
parent | 3b66b429c69183b7dd8d6845b8dd24718e4bbd0d (diff) |
And make sure warning are not treated as errors for GCC -MD run
-rw-r--r-- | build2/cc/compile.cxx | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/build2/cc/compile.cxx b/build2/cc/compile.cxx index f3aef29..7553ac3 100644 --- a/build2/cc/compile.cxx +++ b/build2/cc/compile.cxx @@ -1775,8 +1775,15 @@ namespace build2 // Clang's -M does not imply -w (disable warnings). We also don't // need them in the -MD case (see above) so disable for both. // - if (cid == compiler_id::clang) - args.push_back ("-w"); + // For GCC we want warnings in -MD (see sense_diag) but we don't + // want then to be treated as errors. + // + switch (cid) + { + case compiler_id::clang: args.push_back ("-w"); break; + case compiler_id::gcc: args.push_back ("-Wno-error"); break; + default: break; + } // Previously we used '*' as a target name but it gets expanded to // the current directory file names by GCC (4.9) that comes with |