From c6b7919ba8ba1d337574671cadd6635f6267dc54 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 6 Aug 2017 13:40:12 +0200 Subject: And make sure warning are not treated as errors for GCC -MD run --- build2/cc/compile.cxx | 11 +++++++++-- 1 file 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 -- cgit v1.1