OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 | 7 |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "tools/gn/commands.h" | 9 #include "tools/gn/commands.h" |
10 #include "tools/gn/label_pattern.h" | 10 #include "tools/gn/label_pattern.h" |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 UniqueVector<const Toolchain*> toolchain_matches; | 90 UniqueVector<const Toolchain*> toolchain_matches; |
91 UniqueVector<SourceFile> file_matches; | 91 UniqueVector<SourceFile> file_matches; |
92 if (!ResolveFromCommandLineInput(setup, inputs, all_toolchains, | 92 if (!ResolveFromCommandLineInput(setup, inputs, all_toolchains, |
93 &target_matches, &config_matches, | 93 &target_matches, &config_matches, |
94 &toolchain_matches, &file_matches)) | 94 &toolchain_matches, &file_matches)) |
95 return 1; | 95 return 1; |
96 matches.insert(matches.begin(), | 96 matches.insert(matches.begin(), |
97 target_matches.begin(), target_matches.end()); | 97 target_matches.begin(), target_matches.end()); |
98 } else if (all_toolchains) { | 98 } else if (all_toolchains) { |
99 // List all resolved targets. | 99 // List all resolved targets. |
100 matches = setup->builder()->GetAllResolvedTargets(); | 100 matches = setup->builder().GetAllResolvedTargets(); |
101 } else { | 101 } else { |
102 // List all resolved targets in the default toolchain. | 102 // List all resolved targets in the default toolchain. |
103 for (auto* target : setup->builder()->GetAllResolvedTargets()) { | 103 for (auto* target : setup->builder().GetAllResolvedTargets()) { |
104 if (target->settings()->is_default()) | 104 if (target->settings()->is_default()) |
105 matches.push_back(target); | 105 matches.push_back(target); |
106 } | 106 } |
107 } | 107 } |
108 FilterAndPrintTargets(false, &matches); | 108 FilterAndPrintTargets(false, &matches); |
109 return 0; | 109 return 0; |
110 } | 110 } |
111 | 111 |
112 } // namespace commands | 112 } // namespace commands |
OLD | NEW |