| Index: tools/gn/binary_target_generator.cc
|
| diff --git a/tools/gn/binary_target_generator.cc b/tools/gn/binary_target_generator.cc
|
| index 16dadb2e656dad388e746607fb4653beb83eef32..f6d77e54b74834f9af3b9bce62527b356f78f2fa 100644
|
| --- a/tools/gn/binary_target_generator.cc
|
| +++ b/tools/gn/binary_target_generator.cc
|
| @@ -27,36 +27,28 @@ BinaryTargetGenerator::~BinaryTargetGenerator() {
|
| void BinaryTargetGenerator::DoRun() {
|
| target_->set_output_type(output_type_);
|
|
|
| - FillOutputName();
|
| - if (err_->has_error())
|
| + if (!FillOutputName())
|
| return;
|
|
|
| - FillOutputExtension();
|
| - if (err_->has_error())
|
| + if (!FillOutputExtension())
|
| return;
|
|
|
| - FillSources();
|
| - if (err_->has_error())
|
| + if (!FillSources())
|
| return;
|
|
|
| - FillPublic();
|
| - if (err_->has_error())
|
| + if (!FillPublic())
|
| return;
|
|
|
| - FillCheckIncludes();
|
| - if (err_->has_error())
|
| + if (!FillCheckIncludes())
|
| return;
|
|
|
| - FillInputs();
|
| - if (err_->has_error())
|
| + if (!FillInputs())
|
| return;
|
|
|
| - FillConfigs();
|
| - if (err_->has_error())
|
| + if (!FillConfigs())
|
| return;
|
|
|
| - FillAllowCircularIncludesFrom();
|
| - if (err_->has_error())
|
| + if (!FillAllowCircularIncludesFrom())
|
| return;
|
|
|
| FillCompleteStaticLib();
|
| @@ -71,62 +63,66 @@ void BinaryTargetGenerator::DoRun() {
|
| return;
|
| }
|
|
|
| -void BinaryTargetGenerator::FillCheckIncludes() {
|
| +bool BinaryTargetGenerator::FillCheckIncludes() {
|
| const Value* value = scope_->GetValue(variables::kCheckIncludes, true);
|
| if (!value)
|
| - return;
|
| + return true;
|
| if (!value->VerifyTypeIs(Value::BOOLEAN, err_))
|
| - return;
|
| + return false;
|
| target_->set_check_includes(value->boolean_value());
|
| + return true;
|
| }
|
|
|
| -void BinaryTargetGenerator::FillCompleteStaticLib() {
|
| +bool BinaryTargetGenerator::FillCompleteStaticLib() {
|
| if (target_->output_type() == Target::STATIC_LIBRARY) {
|
| const Value* value = scope_->GetValue(variables::kCompleteStaticLib, true);
|
| if (!value)
|
| - return;
|
| + return true;
|
| if (!value->VerifyTypeIs(Value::BOOLEAN, err_))
|
| - return;
|
| + return false;
|
| target_->set_complete_static_lib(value->boolean_value());
|
| }
|
| + return true;
|
| }
|
|
|
| -void BinaryTargetGenerator::FillOutputName() {
|
| +bool BinaryTargetGenerator::FillOutputName() {
|
| const Value* value = scope_->GetValue(variables::kOutputName, true);
|
| if (!value)
|
| - return;
|
| + return true;
|
| if (!value->VerifyTypeIs(Value::STRING, err_))
|
| - return;
|
| + return false;
|
| target_->set_output_name(value->string_value());
|
| + return true;
|
| }
|
|
|
| -void BinaryTargetGenerator::FillOutputExtension() {
|
| +bool BinaryTargetGenerator::FillOutputExtension() {
|
| const Value* value = scope_->GetValue(variables::kOutputExtension, true);
|
| if (!value)
|
| - return;
|
| + return true;
|
| if (!value->VerifyTypeIs(Value::STRING, err_))
|
| - return;
|
| + return false;
|
| target_->set_output_extension(value->string_value());
|
| + return true;
|
| }
|
|
|
| -void BinaryTargetGenerator::FillAllowCircularIncludesFrom() {
|
| +bool BinaryTargetGenerator::FillAllowCircularIncludesFrom() {
|
| const Value* value = scope_->GetValue(
|
| variables::kAllowCircularIncludesFrom, true);
|
| if (!value)
|
| - return;
|
| + return true;
|
|
|
| UniqueVector<Label> circular;
|
| ExtractListOfUniqueLabels(*value, scope_->GetSourceDir(),
|
| ToolchainLabelForScope(scope_), &circular, err_);
|
| if (err_->has_error())
|
| - return;
|
| + return false;
|
|
|
| // Validate that all circular includes entries are in the deps.
|
| - const LabelTargetVector& deps = target_->deps();
|
| for (size_t circular_i = 0; circular_i < circular.size(); circular_i++) {
|
| bool found_dep = false;
|
| - for (size_t dep_i = 0; dep_i < deps.size(); dep_i++) {
|
| - if (deps[dep_i].label == circular[circular_i]) {
|
| + for (DepsIterator iter(target_, DepsIterator::LINKED_ONLY);
|
| + !iter.done(); iter.Advance()) {
|
| + if (iter.label() == circular[circular_i]) {
|
| found_dep = true;
|
| break;
|
| }
|
| @@ -137,11 +133,12 @@ void BinaryTargetGenerator::FillAllowCircularIncludesFrom() {
|
| "\"\nwas not in the deps of this target. "
|
| "allow_circular_includes_from only allows\ntargets present in the "
|
| "deps.");
|
| - return;
|
| + return false;
|
| }
|
| }
|
|
|
| // Add to the set.
|
| for (size_t i = 0; i < circular.size(); i++)
|
| target_->allow_circular_includes_from().insert(circular[i]);
|
| + return true;
|
| }
|
|
|