diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/manifest_parser.cc | 12 | ||||
-rw-r--r-- | src/manifest_parser.h | 2 |
2 files changed, 9 insertions, 5 deletions
diff --git a/src/manifest_parser.cc b/src/manifest_parser.cc index ede5adb..638d751 100644 --- a/src/manifest_parser.cc +++ b/src/manifest_parser.cc @@ -25,7 +25,7 @@ #include "version.h" ManifestParser::ManifestParser(State* state, FileReader* file_reader) - : state_(state), file_reader_(file_reader) { + : state_(state), file_reader_(file_reader), quiet_(false) { env_ = &state->bindings_; } @@ -329,10 +329,12 @@ bool ManifestParser::ParseEdge(string* err) { if (!CanonicalizePath(&path, &slash_bits, &path_err)) return lexer_.Error(path_err, err); if (!state_->AddOut(edge, path, slash_bits)) { - Warning("multiple rules generate %s. " - "builds involving this target will not be correct; " - "continuing anyway", - path.c_str()); + if (!quiet_) { + Warning("multiple rules generate %s. " + "builds involving this target will not be correct; " + "continuing anyway", + path.c_str()); + } } } if (edge->outputs_.empty()) { diff --git a/src/manifest_parser.h b/src/manifest_parser.h index 5212f72..00a711d 100644 --- a/src/manifest_parser.h +++ b/src/manifest_parser.h @@ -39,6 +39,7 @@ struct ManifestParser { /// Parse a text string of input. Used by tests. bool ParseTest(const string& input, string* err) { + quiet_ = true; return Parse("input", input, err); } @@ -64,6 +65,7 @@ private: BindingEnv* env_; FileReader* file_reader_; Lexer lexer_; + bool quiet_; }; #endif // NINJA_MANIFEST_PARSER_H_ |