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

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

Issue 885283006: gn: Allow users to set 'check_includes' in action_foreach(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: TargetGenerator Created 5 years, 10 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
« no previous file with comments | « tools/gn/target_generator.h ('k') | no next file » | 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_generator.h" 5 #include "tools/gn/target_generator.h"
6 6
7 #include "tools/gn/action_target_generator.h" 7 #include "tools/gn/action_target_generator.h"
8 #include "tools/gn/binary_target_generator.h" 8 #include "tools/gn/binary_target_generator.h"
9 #include "tools/gn/build_settings.h" 9 #include "tools/gn/build_settings.h"
10 #include "tools/gn/config.h" 10 #include "tools/gn/config.h"
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 // Validate that outputs are in the output dir. 276 // Validate that outputs are in the output dir.
277 CHECK(outputs.list().size() == value->list_value().size()); 277 CHECK(outputs.list().size() == value->list_value().size());
278 for (size_t i = 0; i < outputs.list().size(); i++) { 278 for (size_t i = 0; i < outputs.list().size(); i++) {
279 if (!EnsureSubstitutionIsInOutputDir(outputs.list()[i], 279 if (!EnsureSubstitutionIsInOutputDir(outputs.list()[i],
280 value->list_value()[i])) 280 value->list_value()[i]))
281 return false; 281 return false;
282 } 282 }
283 return true; 283 return true;
284 } 284 }
285 285
286 bool TargetGenerator::FillCheckIncludes() {
287 const Value* value = scope_->GetValue(variables::kCheckIncludes, true);
288 if (!value)
289 return true;
290 if (!value->VerifyTypeIs(Value::BOOLEAN, err_))
291 return false;
292 target_->set_check_includes(value->boolean_value());
293 return true;
294 }
295
286 bool TargetGenerator::EnsureSubstitutionIsInOutputDir( 296 bool TargetGenerator::EnsureSubstitutionIsInOutputDir(
287 const SubstitutionPattern& pattern, 297 const SubstitutionPattern& pattern,
288 const Value& original_value) { 298 const Value& original_value) {
289 if (pattern.ranges().empty()) { 299 if (pattern.ranges().empty()) {
290 // Pattern is empty, error out (this prevents weirdness below). 300 // Pattern is empty, error out (this prevents weirdness below).
291 *err_ = Err(original_value, "This has an empty value in it."); 301 *err_ = Err(original_value, "This has an empty value in it.");
292 return false; 302 return false;
293 } 303 }
294 304
295 if (pattern.ranges()[0].type == SUBSTITUTION_LITERAL) { 305 if (pattern.ranges()[0].type == SUBSTITUTION_LITERAL) {
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 bool TargetGenerator::FillForwardDependentConfigs() { 347 bool TargetGenerator::FillForwardDependentConfigs() {
338 const Value* value = scope_->GetValue( 348 const Value* value = scope_->GetValue(
339 variables::kForwardDependentConfigsFrom, true); 349 variables::kForwardDependentConfigsFrom, true);
340 if (value) { 350 if (value) {
341 ExtractListOfUniqueLabels(*value, scope_->GetSourceDir(), 351 ExtractListOfUniqueLabels(*value, scope_->GetSourceDir(),
342 ToolchainLabelForScope(scope_), 352 ToolchainLabelForScope(scope_),
343 &target_->forward_dependent_configs(), err_); 353 &target_->forward_dependent_configs(), err_);
344 } 354 }
345 return !err_->has_error(); 355 return !err_->has_error();
346 } 356 }
OLDNEW
« no previous file with comments | « tools/gn/target_generator.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698