Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(74)

Side by Side Diff: tools/gn/ninja_group_target_writer.cc

Issue 48523006: GN: Separately track labels and origins for lists of stuff (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tools/gn/ninja_binary_target_writer_unittest.cc ('k') | tools/gn/ninja_target_writer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 }
OLDNEW
« no previous file with comments | « tools/gn/ninja_binary_target_writer_unittest.cc ('k') | tools/gn/ninja_target_writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698