summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/build.cc2
-rw-r--r--src/manifest_parser.cc8
-rw-r--r--src/manifest_parser_test.cc12
3 files changed, 21 insertions, 1 deletions
diff --git a/src/build.cc b/src/build.cc
index 56f2d9b..0caf6e7 100644
--- a/src/build.cc
+++ b/src/build.cc
@@ -873,7 +873,7 @@ void Builder::FinishCommand(CommandRunner::Result* result) {
}
if (!deps_type.empty() && scan_.deps_log()) {
- // XXX figure out multiple outputs.
+ assert(edge->outputs_.size() == 1);
Node* out = edge->outputs_[0];
// XXX need to restat for restat_mtime.
scan_.deps_log()->RecordDeps(out, restat_mtime, deps_nodes);
diff --git a/src/manifest_parser.cc b/src/manifest_parser.cc
index 14fca73..a581114 100644
--- a/src/manifest_parser.cc
+++ b/src/manifest_parser.cc
@@ -329,6 +329,14 @@ bool ManifestParser::ParseEdge(string* err) {
edge->implicit_deps_ = implicit;
edge->order_only_deps_ = order_only;
+ // Multiple outputs aren't (yet?) supported with depslog.
+ string deps_type = edge->GetBinding("deps");
+ if (!deps_type.empty() && edge->outputs_.size() > 1) {
+ return lexer_.Error("multiple outputs aren't (yet?) supported by depslog; "
+ "bring this up on the mailing list if it affects you",
+ err);
+ }
+
return true;
}
diff --git a/src/manifest_parser_test.cc b/src/manifest_parser_test.cc
index 4ac093f..76d235d 100644
--- a/src/manifest_parser_test.cc
+++ b/src/manifest_parser_test.cc
@@ -71,6 +71,7 @@ TEST_F(ParserTest, RuleAttributes) {
"rule cat\n"
" command = a\n"
" depfile = a\n"
+" deps = a\n"
" description = a\n"
" generator = a\n"
" restat = a\n"
@@ -599,6 +600,17 @@ TEST_F(ParserTest, MultipleOutputs) {
EXPECT_EQ("", err);
}
+TEST_F(ParserTest, MultipleOutputsWithDeps) {
+ State state;
+ ManifestParser parser(&state, NULL);
+ string err;
+ EXPECT_FALSE(parser.ParseTest("rule cc\n command = foo\n deps = gcc\n"
+ "build a.o b.o: cc c.cc\n",
+ &err));
+ EXPECT_EQ("input:5: multiple outputs aren't (yet?) supported by depslog; "
+ "bring this up on the mailing list if it affects you\n", err);
+}
+
TEST_F(ParserTest, SubNinja) {
files_["test.ninja"] =
"var = inner\n"