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

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

Issue 1621053002: Add an assert_no_deps variable to GN. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comment fix Created 4 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') | 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_generator.h" 5 #include "tools/gn/target_generator.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "tools/gn/action_target_generator.h" 9 #include "tools/gn/action_target_generator.h"
10 #include "tools/gn/binary_target_generator.h" 10 #include "tools/gn/binary_target_generator.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 43
44 if (!FillData()) 44 if (!FillData())
45 return; 45 return;
46 46
47 if (!FillDependencies()) 47 if (!FillDependencies())
48 return; 48 return;
49 49
50 if (!FillTestonly()) 50 if (!FillTestonly())
51 return; 51 return;
52 52
53 if (!FillAssertNoDeps())
54 return;
55
53 if (!Visibility::FillItemVisibility(target_, scope_, err_)) 56 if (!Visibility::FillItemVisibility(target_, scope_, err_))
54 return; 57 return;
55 58
56 // Do type-specific generation. 59 // Do type-specific generation.
57 DoRun(); 60 DoRun();
58 } 61 }
59 62
60 // static 63 // static
61 void TargetGenerator::GenerateTarget(Scope* scope, 64 void TargetGenerator::GenerateTarget(Scope* scope,
62 const FunctionCallNode* function_call, 65 const FunctionCallNode* function_call,
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 bool TargetGenerator::FillTestonly() { 262 bool TargetGenerator::FillTestonly() {
260 const Value* value = scope_->GetValue(variables::kTestonly, true); 263 const Value* value = scope_->GetValue(variables::kTestonly, true);
261 if (value) { 264 if (value) {
262 if (!value->VerifyTypeIs(Value::BOOLEAN, err_)) 265 if (!value->VerifyTypeIs(Value::BOOLEAN, err_))
263 return false; 266 return false;
264 target_->set_testonly(value->boolean_value()); 267 target_->set_testonly(value->boolean_value());
265 } 268 }
266 return true; 269 return true;
267 } 270 }
268 271
272 bool TargetGenerator::FillAssertNoDeps() {
273 const Value* value = scope_->GetValue(variables::kAssertNoDeps, true);
274 if (value) {
275 return ExtractListOfLabelPatterns(*value, scope_->GetSourceDir(),
276 &target_->assert_no_deps(), err_);
277 }
278 return true;
279 }
280
269 bool TargetGenerator::FillOutputs(bool allow_substitutions) { 281 bool TargetGenerator::FillOutputs(bool allow_substitutions) {
270 const Value* value = scope_->GetValue(variables::kOutputs, true); 282 const Value* value = scope_->GetValue(variables::kOutputs, true);
271 if (!value) 283 if (!value)
272 return true; 284 return true;
273 285
274 SubstitutionList& outputs = target_->action_values().outputs(); 286 SubstitutionList& outputs = target_->action_values().outputs();
275 if (!outputs.Parse(*value, err_)) 287 if (!outputs.Parse(*value, err_))
276 return false; 288 return false;
277 289
278 if (!allow_substitutions) { 290 if (!allow_substitutions) {
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 366
355 bool TargetGenerator::FillGenericDeps(const char* var_name, 367 bool TargetGenerator::FillGenericDeps(const char* var_name,
356 LabelTargetVector* dest) { 368 LabelTargetVector* dest) {
357 const Value* value = scope_->GetValue(var_name, true); 369 const Value* value = scope_->GetValue(var_name, true);
358 if (value) { 370 if (value) {
359 ExtractListOfLabels(*value, scope_->GetSourceDir(), 371 ExtractListOfLabels(*value, scope_->GetSourceDir(),
360 ToolchainLabelForScope(scope_), dest, err_); 372 ToolchainLabelForScope(scope_), dest, err_);
361 } 373 }
362 return !err_->has_error(); 374 return !err_->has_error();
363 } 375 }
OLDNEW
« no previous file with comments | « tools/gn/target_generator.h ('k') | tools/gn/target_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698