| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "tools/gn/ninja_group_target_writer.h" | 5 #include "tools/gn/ninja_group_target_writer.h" |
| 6 | 6 |
| 7 #include "base/strings/string_util.h" | 7 #include "base/strings/string_util.h" |
| 8 #include "tools/gn/string_utils.h" | 8 #include "tools/gn/string_utils.h" |
| 9 | 9 |
| 10 NinjaGroupTargetWriter::NinjaGroupTargetWriter(const Target* target, | 10 NinjaGroupTargetWriter::NinjaGroupTargetWriter(const Target* target, |
| 11 std::ostream& out) | 11 std::ostream& out) |
| 12 : NinjaTargetWriter(target, out) { | 12 : NinjaTargetWriter(target, out) { |
| 13 } | 13 } |
| 14 | 14 |
| 15 NinjaGroupTargetWriter::~NinjaGroupTargetWriter() { | 15 NinjaGroupTargetWriter::~NinjaGroupTargetWriter() { |
| 16 } | 16 } |
| 17 | 17 |
| 18 void NinjaGroupTargetWriter::Run() { | 18 void NinjaGroupTargetWriter::Run() { |
| 19 // A group rule just generates a stamp file with dependencies on each of | 19 // A group rule just generates a stamp file with dependencies on each of |
| 20 // the deps in the group. | 20 // the deps in the group. |
| 21 out_ << std::endl << "build "; | 21 out_ << std::endl << "build "; |
| 22 path_output_.WriteFile(out_, helper_.GetTargetOutputFile(target_)); | 22 path_output_.WriteFile(out_, helper_.GetTargetOutputFile(target_)); |
| 23 out_ << ": " | 23 out_ << ": " |
| 24 << helper_.GetRulePrefix(target_->settings()->toolchain()) | 24 << helper_.GetRulePrefix(target_->settings()->toolchain()) |
| 25 << "stamp"; | 25 << "stamp"; |
| 26 | 26 |
| 27 const std::vector<const Target*>& deps = target_->deps(); | 27 const LabelTargetVector& deps = target_->deps(); |
| 28 for (size_t i = 0; i < deps.size(); i++) { | 28 for (size_t i = 0; i < deps.size(); i++) { |
| 29 out_ << " "; | 29 out_ << " "; |
| 30 path_output_.WriteFile(out_, helper_.GetTargetOutputFile(deps[i])); | 30 path_output_.WriteFile(out_, helper_.GetTargetOutputFile(deps[i].ptr)); |
| 31 } | 31 } |
| 32 | 32 |
| 33 const std::vector<const Target*>& datadeps = target_->datadeps(); | 33 const LabelTargetVector& datadeps = target_->datadeps(); |
| 34 for (size_t i = 0; i < datadeps.size(); i++) { | 34 for (size_t i = 0; i < datadeps.size(); i++) { |
| 35 out_ << " "; | 35 out_ << " "; |
| 36 path_output_.WriteFile(out_, helper_.GetTargetOutputFile(datadeps[i])); | 36 path_output_.WriteFile(out_, helper_.GetTargetOutputFile(datadeps[i].ptr)); |
| 37 } | 37 } |
| 38 out_ << std::endl; | 38 out_ << std::endl; |
| 39 } | 39 } |
| OLD | NEW |