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

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

Issue 26537002: Add a UniqueVector class to GN (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: REview comments, remove npos Created 6 years, 4 months 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
« no previous file with comments | « tools/gn/builder.cc ('k') | tools/gn/gn.gyp » ('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 <algorithm> 5 #include <algorithm>
6 #include <set> 6 #include <set>
7 #include <sstream> 7 #include <sstream>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "tools/gn/commands.h" 10 #include "tools/gn/commands.h"
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 if (display_header) 243 if (display_header)
244 OutputString("\n" + heading + " (in order applying):\n"); 244 OutputString("\n" + heading + " (in order applying):\n");
245 245
246 Label toolchain_label = target->label().GetToolchainLabel(); 246 Label toolchain_label = target->label().GetToolchainLabel();
247 for (size_t i = 0; i < configs.size(); i++) { 247 for (size_t i = 0; i < configs.size(); i++) {
248 OutputString(" " + 248 OutputString(" " +
249 configs[i].label.GetUserVisibleName(toolchain_label) + "\n"); 249 configs[i].label.GetUserVisibleName(toolchain_label) + "\n");
250 } 250 }
251 } 251 }
252 252
253 void PrintConfigsVector(const Target* target,
254 const UniqueVector<LabelConfigPair>& configs,
255 const std::string& heading,
256 bool display_header) {
257 if (configs.empty())
258 return;
259
260 // Don't sort since the order determines how things are processed.
261 if (display_header)
262 OutputString("\n" + heading + " (in order applying):\n");
263
264 Label toolchain_label = target->label().GetToolchainLabel();
265 for (size_t i = 0; i < configs.size(); i++) {
266 OutputString(" " +
267 configs[i].label.GetUserVisibleName(toolchain_label) + "\n");
268 }
269 }
270
253 void PrintConfigs(const Target* target, bool display_header) { 271 void PrintConfigs(const Target* target, bool display_header) {
254 PrintConfigsVector(target, target->configs(), "configs", display_header); 272 PrintConfigsVector(target, target->configs().vector(), "configs",
273 display_header);
255 } 274 }
256 275
257 void PrintDirectDependentConfigs(const Target* target, bool display_header) { 276 void PrintDirectDependentConfigs(const Target* target, bool display_header) {
258 PrintConfigsVector(target, target->direct_dependent_configs(), 277 PrintConfigsVector(target, target->direct_dependent_configs(),
259 "direct_dependent_configs", display_header); 278 "direct_dependent_configs", display_header);
260 } 279 }
261 280
262 void PrintAllDependentConfigs(const Target* target, bool display_header) { 281 void PrintAllDependentConfigs(const Target* target, bool display_header) {
263 PrintConfigsVector(target, target->all_dependent_configs(), 282 PrintConfigsVector(target, target->all_dependent_configs(),
264 "all_dependent_configs", display_header); 283 "all_dependent_configs", display_header);
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
645 // so always display them, even for groups and such. 664 // so always display them, even for groups and such.
646 PrintLibs(target, true); 665 PrintLibs(target, true);
647 PrintLibDirs(target, true); 666 PrintLibDirs(target, true);
648 667
649 PrintDeps(target, true); 668 PrintDeps(target, true);
650 669
651 return 0; 670 return 0;
652 } 671 }
653 672
654 } // namespace commands 673 } // namespace commands
OLDNEW
« no previous file with comments | « tools/gn/builder.cc ('k') | tools/gn/gn.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698