diff options
author | Evan Martin <martine@danga.com> | 2013-04-05 17:27:22 (GMT) |
---|---|---|
committer | Evan Martin <martine@danga.com> | 2013-04-08 22:02:46 (GMT) |
commit | adc4ee81443dbfae8584456c04ea1ba383da3d01 (patch) | |
tree | 7d2a8469583a476954b5adcd107e3703d7dd20d2 /src | |
parent | c47f2cedbb8f44182a72343d0c71f5af5196d274 (diff) | |
download | Ninja-adc4ee81443dbfae8584456c04ea1ba383da3d01.zip Ninja-adc4ee81443dbfae8584456c04ea1ba383da3d01.tar.gz Ninja-adc4ee81443dbfae8584456c04ea1ba383da3d01.tar.bz2 |
make it an error for now to have multiple outputs with depslog
Diffstat (limited to 'src')
-rw-r--r-- | src/build.cc | 2 | ||||
-rw-r--r-- | src/manifest_parser.cc | 8 | ||||
-rw-r--r-- | src/manifest_parser_test.cc | 12 |
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" |