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/target.h" | 5 #include "tools/gn/target.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "tools/gn/config_values_extractors.h" | 8 #include "tools/gn/config_values_extractors.h" |
9 #include "tools/gn/scheduler.h" | 9 #include "tools/gn/scheduler.h" |
10 | 10 |
11 namespace { | 11 namespace { |
12 | 12 |
13 typedef std::set<const Config*> ConfigSet; | 13 typedef std::set<const Config*> ConfigSet; |
14 | 14 |
15 void TargetResolvedThunk(const base::Callback<void(const Target*)>& cb, | |
16 const Target* t) { | |
17 cb.Run(t); | |
18 } | |
19 | |
20 // Merges the dependent configs from the given target to the given config list. | 15 // Merges the dependent configs from the given target to the given config list. |
21 // The unique_configs list is used for de-duping so values already added will | 16 // The unique_configs list is used for de-duping so values already added will |
22 // not be added again. | 17 // not be added again. |
23 void MergeDirectDependentConfigsFrom(const Target* from_target, | 18 void MergeDirectDependentConfigsFrom(const Target* from_target, |
24 ConfigSet* unique_configs, | 19 ConfigSet* unique_configs, |
25 LabelConfigVector* dest) { | 20 LabelConfigVector* dest) { |
26 const LabelConfigVector& direct = from_target->direct_dependent_configs(); | 21 const LabelConfigVector& direct = from_target->direct_dependent_configs(); |
27 for (size_t i = 0; i < direct.size(); i++) { | 22 for (size_t i = 0; i < direct.size(); i++) { |
28 if (unique_configs->find(direct[i].ptr) == unique_configs->end()) { | 23 if (unique_configs->find(direct[i].ptr) == unique_configs->end()) { |
29 unique_configs->insert(direct[i].ptr); | 24 unique_configs->insert(direct[i].ptr); |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 // don't need to bother copying to our configs, only forwarding. | 188 // don't need to bother copying to our configs, only forwarding. |
194 DCHECK(std::find_if(deps_.begin(), deps_.end(), | 189 DCHECK(std::find_if(deps_.begin(), deps_.end(), |
195 LabelPtrPtrEquals<Target>(from_target)) != | 190 LabelPtrPtrEquals<Target>(from_target)) != |
196 deps_.end()); | 191 deps_.end()); |
197 direct_dependent_configs_.insert( | 192 direct_dependent_configs_.insert( |
198 direct_dependent_configs_.end(), | 193 direct_dependent_configs_.end(), |
199 from_target->direct_dependent_configs().begin(), | 194 from_target->direct_dependent_configs().begin(), |
200 from_target->direct_dependent_configs().end()); | 195 from_target->direct_dependent_configs().end()); |
201 } | 196 } |
202 } | 197 } |
OLD | NEW |