| 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/binary_target_generator.h" | 7 #include "tools/gn/binary_target_generator.h" |
| 8 #include "tools/gn/build_settings.h" | 8 #include "tools/gn/build_settings.h" |
| 9 #include "tools/gn/config.h" | 9 #include "tools/gn/config.h" |
| 10 #include "tools/gn/copy_target_generator.h" | 10 #include "tools/gn/copy_target_generator.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 } | 34 } |
| 35 | 35 |
| 36 TargetGenerator::~TargetGenerator() { | 36 TargetGenerator::~TargetGenerator() { |
| 37 } | 37 } |
| 38 | 38 |
| 39 void TargetGenerator::Run() { | 39 void TargetGenerator::Run() { |
| 40 // All target types use these. | 40 // All target types use these. |
| 41 FillDependentConfigs(); | 41 FillDependentConfigs(); |
| 42 FillData(); | 42 FillData(); |
| 43 FillDependencies(); | 43 FillDependencies(); |
| 44 FillGypFile(); |
| 44 | 45 |
| 45 // To type-specific generation. | 46 // To type-specific generation. |
| 46 DoRun(); | 47 DoRun(); |
| 47 | 48 |
| 48 // Mark the target as complete. | 49 // Mark the target as complete. |
| 49 if (!err_->has_error()) { | 50 if (!err_->has_error()) { |
| 50 target_->SetGenerated(&function_token_); | 51 target_->SetGenerated(&function_token_); |
| 51 GetBuildSettings()->target_manager().TargetGenerationComplete( | 52 GetBuildSettings()->target_manager().TargetGenerationComplete( |
| 52 target_->label(), err_); | 53 target_->label(), err_); |
| 53 } | 54 } |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 FillGenericDeps(variables::kDeps, &Target::deps); | 172 FillGenericDeps(variables::kDeps, &Target::deps); |
| 172 FillGenericDeps(variables::kDatadeps, &Target::datadeps); | 173 FillGenericDeps(variables::kDatadeps, &Target::datadeps); |
| 173 | 174 |
| 174 // This is a list of dependent targets to have their configs fowarded, so | 175 // This is a list of dependent targets to have their configs fowarded, so |
| 175 // it goes here rather than in FillConfigs. | 176 // it goes here rather than in FillConfigs. |
| 176 FillForwardDependentConfigs(); | 177 FillForwardDependentConfigs(); |
| 177 | 178 |
| 178 FillHardDep(); | 179 FillHardDep(); |
| 179 } | 180 } |
| 180 | 181 |
| 182 void TargetGenerator::FillGypFile() { |
| 183 const Value* gyp_file_value = scope_->GetValue(variables::kGypFile, true); |
| 184 if (!gyp_file_value) |
| 185 return; |
| 186 if (!gyp_file_value->VerifyTypeIs(Value::STRING, err_)) |
| 187 return; |
| 188 |
| 189 target_->set_gyp_file(scope_->GetSourceDir().ResolveRelativeFile( |
| 190 gyp_file_value->string_value())); |
| 191 } |
| 192 |
| 181 void TargetGenerator::FillHardDep() { | 193 void TargetGenerator::FillHardDep() { |
| 182 const Value* hard_dep_value = scope_->GetValue(variables::kHardDep, true); | 194 const Value* hard_dep_value = scope_->GetValue(variables::kHardDep, true); |
| 183 if (!hard_dep_value) | 195 if (!hard_dep_value) |
| 184 return; | 196 return; |
| 185 if (!hard_dep_value->VerifyTypeIs(Value::BOOLEAN, err_)) | 197 if (!hard_dep_value->VerifyTypeIs(Value::BOOLEAN, err_)) |
| 186 return; | 198 return; |
| 187 target_->set_hard_dep(hard_dep_value->boolean_value()); | 199 target_->set_hard_dep(hard_dep_value->boolean_value()); |
| 188 } | 200 } |
| 189 | 201 |
| 190 void TargetGenerator::FillExternal() { | 202 void TargetGenerator::FillExternal() { |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 forward_from_list.push_back(forward_from); | 324 forward_from_list.push_back(forward_from); |
| 313 } | 325 } |
| 314 | 326 |
| 315 target_->forward_dependent_configs().swap(forward_from_list); | 327 target_->forward_dependent_configs().swap(forward_from_list); |
| 316 } | 328 } |
| 317 | 329 |
| 318 | 330 |
| 319 | 331 |
| 320 | 332 |
| 321 | 333 |
| OLD | NEW |