| 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 <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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |