aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build2/cc/compile.cxx11
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