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

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

Issue 301243002: Don't inherit source sets across static libs in GN. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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_unittest.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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 dep->output_type() == SHARED_LIBRARY || 170 dep->output_type() == SHARED_LIBRARY ||
171 dep->output_type() == SOURCE_SET) 171 dep->output_type() == SOURCE_SET)
172 inherited_libraries_.insert(dep); 172 inherited_libraries_.insert(dep);
173 173
174 // Inherited libraries and flags are inherited across static library 174 // Inherited libraries and flags are inherited across static library
175 // boundaries. 175 // boundaries.
176 if (dep->output_type() != SHARED_LIBRARY && 176 if (dep->output_type() != SHARED_LIBRARY &&
177 dep->output_type() != EXECUTABLE) { 177 dep->output_type() != EXECUTABLE) {
178 const std::set<const Target*> inherited = dep->inherited_libraries(); 178 const std::set<const Target*> inherited = dep->inherited_libraries();
179 for (std::set<const Target*>::const_iterator i = inherited.begin(); 179 for (std::set<const Target*>::const_iterator i = inherited.begin();
180 i != inherited.end(); ++i) 180 i != inherited.end(); ++i) {
181 inherited_libraries_.insert(*i); 181 // Don't copy source sets across static library boundaries. The static
182 // library will include all the files from the source set.
183 if (!(dep->output_type() == STATIC_LIBRARY &&
184 (*i)->output_type() == SOURCE_SET))
185 inherited_libraries_.insert(*i);
186 }
182 187
183 // Inherited library settings. 188 // Inherited library settings.
184 all_lib_dirs_.append(dep->all_lib_dirs()); 189 all_lib_dirs_.append(dep->all_lib_dirs());
185 all_libs_.append(dep->all_libs()); 190 all_libs_.append(dep->all_libs());
186 } 191 }
187 } 192 }
188 } 193 }
189 194
190 void Target::PullForwardedDependentConfigs() { 195 void Target::PullForwardedDependentConfigs() {
191 // Groups implicitly forward all if its dependency's configs. 196 // Groups implicitly forward all if its dependency's configs.
(...skipping 24 matching lines...) Expand all
216 221
217 // Android STL doesn't like insert(begin, end) so do it manually. 222 // Android STL doesn't like insert(begin, end) so do it manually.
218 // TODO(brettw) this can be changed to insert(dep->begin(), dep->end()) when 223 // TODO(brettw) this can be changed to insert(dep->begin(), dep->end()) when
219 // Android uses a better STL. 224 // Android uses a better STL.
220 for (std::set<const Target*>::const_iterator cur = 225 for (std::set<const Target*>::const_iterator cur =
221 dep->recursive_hard_deps().begin(); 226 dep->recursive_hard_deps().begin();
222 cur != dep->recursive_hard_deps().end(); ++cur) 227 cur != dep->recursive_hard_deps().end(); ++cur)
223 recursive_hard_deps_.insert(*cur); 228 recursive_hard_deps_.insert(*cur);
224 } 229 }
225 } 230 }
OLDNEW
« no previous file with comments | « tools/gn/target.h ('k') | tools/gn/target_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698