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_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 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 if (!FillGenericDeps(variables::kDataDeps, &target_->data_deps())) | 240 if (!FillGenericDeps(variables::kDataDeps, &target_->data_deps())) |
241 return false; | 241 return false; |
242 | 242 |
243 // "data_deps" was previously named "datadeps". For backwards-compat, read | 243 // "data_deps" was previously named "datadeps". For backwards-compat, read |
244 // the old one if no "data_deps" were specified. | 244 // the old one if no "data_deps" were specified. |
245 if (!scope_->GetValue(variables::kDataDeps, false)) { | 245 if (!scope_->GetValue(variables::kDataDeps, false)) { |
246 if (!FillGenericDeps("datadeps", &target_->data_deps())) | 246 if (!FillGenericDeps("datadeps", &target_->data_deps())) |
247 return false; | 247 return false; |
248 } | 248 } |
249 | 249 |
250 // This is a list of dependent targets to have their configs fowarded, so | |
251 // it goes here rather than in FillConfigs. | |
252 if (!FillForwardDependentConfigs()) | |
253 return false; | |
254 return true; | 250 return true; |
255 } | 251 } |
256 | 252 |
257 bool TargetGenerator::FillTestonly() { | 253 bool TargetGenerator::FillTestonly() { |
258 const Value* value = scope_->GetValue(variables::kTestonly, true); | 254 const Value* value = scope_->GetValue(variables::kTestonly, true); |
259 if (value) { | 255 if (value) { |
260 if (!value->VerifyTypeIs(Value::BOOLEAN, err_)) | 256 if (!value->VerifyTypeIs(Value::BOOLEAN, err_)) |
261 return false; | 257 return false; |
262 target_->set_testonly(value->boolean_value()); | 258 target_->set_testonly(value->boolean_value()); |
263 } | 259 } |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 | 348 |
353 bool TargetGenerator::FillGenericDeps(const char* var_name, | 349 bool TargetGenerator::FillGenericDeps(const char* var_name, |
354 LabelTargetVector* dest) { | 350 LabelTargetVector* dest) { |
355 const Value* value = scope_->GetValue(var_name, true); | 351 const Value* value = scope_->GetValue(var_name, true); |
356 if (value) { | 352 if (value) { |
357 ExtractListOfLabels(*value, scope_->GetSourceDir(), | 353 ExtractListOfLabels(*value, scope_->GetSourceDir(), |
358 ToolchainLabelForScope(scope_), dest, err_); | 354 ToolchainLabelForScope(scope_), dest, err_); |
359 } | 355 } |
360 return !err_->has_error(); | 356 return !err_->has_error(); |
361 } | 357 } |
362 | |
363 bool TargetGenerator::FillForwardDependentConfigs() { | |
364 const Value* value = scope_->GetValue( | |
365 variables::kForwardDependentConfigsFrom, true); | |
366 if (value) { | |
367 ExtractListOfUniqueLabels(*value, scope_->GetSourceDir(), | |
368 ToolchainLabelForScope(scope_), | |
369 &target_->forward_dependent_configs(), err_); | |
370 } | |
371 return !err_->has_error(); | |
372 } | |
OLD | NEW |