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

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

Issue 26267003: Add the concept of a source set to GN. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « tools/gn/target.h ('k') | tools/gn/target_generator.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/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
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 void Target::PullDependentTargetInfo(std::set<const Config*>* unique_configs) { 181 void Target::PullDependentTargetInfo(std::set<const Config*>* unique_configs) {
182 // Gather info from our dependents we need. 182 // Gather info from our dependents we need.
183 for (size_t dep_i = 0; dep_i < deps_.size(); dep_i++) { 183 for (size_t dep_i = 0; dep_i < deps_.size(); dep_i++) {
184 const Target* dep = deps_[dep_i]; 184 const Target* dep = deps_[dep_i];
185 MergeAllDependentConfigsFrom(dep, unique_configs, &configs_, 185 MergeAllDependentConfigsFrom(dep, unique_configs, &configs_,
186 &all_dependent_configs_); 186 &all_dependent_configs_);
187 MergeDirectDependentConfigsFrom(dep, unique_configs, &configs_); 187 MergeDirectDependentConfigsFrom(dep, unique_configs, &configs_);
188 188
189 // Direct dependent libraries. 189 // Direct dependent libraries.
190 if (dep->output_type() == STATIC_LIBRARY || 190 if (dep->output_type() == STATIC_LIBRARY ||
191 dep->output_type() == SHARED_LIBRARY) 191 dep->output_type() == SHARED_LIBRARY ||
192 dep->output_type() == SOURCE_SET)
192 inherited_libraries_.insert(dep); 193 inherited_libraries_.insert(dep);
193 194
194 // Inherited libraries and flags are inherited across static library 195 // Inherited libraries and flags are inherited across static library
195 // boundaries. For external targets, assume that the external_link_deps 196 // boundaries. For external targets, assume that the external_link_deps
196 // will take care of this. 197 // will take care of this.
197 if ((!dep->external() || 198 if ((!dep->external() ||
198 !settings()->build_settings()->using_external_generator()) && 199 !settings()->build_settings()->using_external_generator()) &&
199 dep->output_type() != SHARED_LIBRARY && 200 dep->output_type() != SHARED_LIBRARY &&
200 dep->output_type() != EXECUTABLE) { 201 dep->output_type() != EXECUTABLE) {
201 const std::set<const Target*> inherited = dep->inherited_libraries(); 202 const std::set<const Target*> inherited = dep->inherited_libraries();
(...skipping 14 matching lines...) Expand all
216 // The forward_dependent_configs_ must be in the deps already, so we 217 // The forward_dependent_configs_ must be in the deps already, so we
217 // don't need to bother copying to our configs, only forwarding. 218 // don't need to bother copying to our configs, only forwarding.
218 DCHECK(std::find(deps_.begin(), deps_.end(), from_target) != 219 DCHECK(std::find(deps_.begin(), deps_.end(), from_target) !=
219 deps_.end()); 220 deps_.end());
220 const std::vector<const Config*>& direct = 221 const std::vector<const Config*>& direct =
221 from_target->direct_dependent_configs(); 222 from_target->direct_dependent_configs();
222 for (size_t i = 0; i < direct.size(); i++) 223 for (size_t i = 0; i < direct.size(); i++)
223 direct_dependent_configs_.push_back(direct[i]); 224 direct_dependent_configs_.push_back(direct[i]);
224 } 225 }
225 } 226 }
OLDNEW
« no previous file with comments | « tools/gn/target.h ('k') | tools/gn/target_generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698