| 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 <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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 if (g_scheduler->verbose_logging()) | 80 if (g_scheduler->verbose_logging()) |
| 81 g_scheduler->Log("Defining target", label.GetUserVisibleName(true)); | 81 g_scheduler->Log("Defining target", label.GetUserVisibleName(true)); |
| 82 | 82 |
| 83 scoped_ptr<Target> target(new Target(scope->settings(), label)); | 83 scoped_ptr<Target> target(new Target(scope->settings(), label)); |
| 84 target->set_defined_from(function_call); | 84 target->set_defined_from(function_call); |
| 85 | 85 |
| 86 // Create and call out to the proper generator. | 86 // Create and call out to the proper generator. |
| 87 if (output_type == functions::kCopy) { | 87 if (output_type == functions::kCopy) { |
| 88 CopyTargetGenerator generator(target.get(), scope, function_call, err); | 88 CopyTargetGenerator generator(target.get(), scope, function_call, err); |
| 89 generator.Run(); | 89 generator.Run(); |
| 90 } else if (output_type == functions::kCopyBundleData) { |
| 91 CopyBundleDataTargetGenerator generator( |
| 92 target.get(), scope, function_call, err); |
| 93 generator.Run(); |
| 90 } else if (output_type == functions::kAction) { | 94 } else if (output_type == functions::kAction) { |
| 91 ActionTargetGenerator generator(target.get(), scope, function_call, | 95 ActionTargetGenerator generator(target.get(), scope, function_call, |
| 92 Target::ACTION, err); | 96 Target::ACTION, err); |
| 93 generator.Run(); | 97 generator.Run(); |
| 94 } else if (output_type == functions::kActionForEach) { | 98 } else if (output_type == functions::kActionForEach) { |
| 95 ActionTargetGenerator generator(target.get(), scope, function_call, | 99 ActionTargetGenerator generator(target.get(), scope, function_call, |
| 96 Target::ACTION_FOREACH, err); | 100 Target::ACTION_FOREACH, err); |
| 97 generator.Run(); | 101 generator.Run(); |
| 98 } else if (output_type == functions::kExecutable) { | 102 } else if (output_type == functions::kExecutable) { |
| 99 BinaryTargetGenerator generator(target.get(), scope, function_call, | 103 BinaryTargetGenerator generator(target.get(), scope, function_call, |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 354 | 358 |
| 355 bool TargetGenerator::FillGenericDeps(const char* var_name, | 359 bool TargetGenerator::FillGenericDeps(const char* var_name, |
| 356 LabelTargetVector* dest) { | 360 LabelTargetVector* dest) { |
| 357 const Value* value = scope_->GetValue(var_name, true); | 361 const Value* value = scope_->GetValue(var_name, true); |
| 358 if (value) { | 362 if (value) { |
| 359 ExtractListOfLabels(*value, scope_->GetSourceDir(), | 363 ExtractListOfLabels(*value, scope_->GetSourceDir(), |
| 360 ToolchainLabelForScope(scope_), dest, err_); | 364 ToolchainLabelForScope(scope_), dest, err_); |
| 361 } | 365 } |
| 362 return !err_->has_error(); | 366 return !err_->has_error(); |
| 363 } | 367 } |
| OLD | NEW |