| 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 | 81 |
| 82 // The location of the target is the directory name with no slash at the end. | 82 // The location of the target is the directory name with no slash at the end. |
| 83 // FIXME(brettw) validate name. | 83 // FIXME(brettw) validate name. |
| 84 const Label& toolchain_label = ToolchainLabelForScope(scope); | 84 const Label& toolchain_label = ToolchainLabelForScope(scope); |
| 85 Label label(scope->GetSourceDir(), args[0].string_value(), | 85 Label label(scope->GetSourceDir(), args[0].string_value(), |
| 86 toolchain_label.dir(), toolchain_label.name()); | 86 toolchain_label.dir(), toolchain_label.name()); |
| 87 | 87 |
| 88 if (g_scheduler->verbose_logging()) | 88 if (g_scheduler->verbose_logging()) |
| 89 g_scheduler->Log("Defining target", label.GetUserVisibleName(true)); | 89 g_scheduler->Log("Defining target", label.GetUserVisibleName(true)); |
| 90 | 90 |
| 91 std::unique_ptr<Target> target(new Target(scope->settings(), label)); | 91 std::unique_ptr<Target> target( |
| 92 new Target(scope->settings(), label, scope->input_files())); |
| 92 target->set_defined_from(function_call); | 93 target->set_defined_from(function_call); |
| 93 | 94 |
| 94 // Create and call out to the proper generator. | 95 // Create and call out to the proper generator. |
| 95 if (output_type == functions::kBundleData) { | 96 if (output_type == functions::kBundleData) { |
| 96 BundleDataTargetGenerator generator( | 97 BundleDataTargetGenerator generator( |
| 97 target.get(), scope, function_call, err); | 98 target.get(), scope, function_call, err); |
| 98 generator.Run(); | 99 generator.Run(); |
| 99 } else if (output_type == functions::kCreateBundle) { | 100 } else if (output_type == functions::kCreateBundle) { |
| 100 CreateBundleTargetGenerator generator(target.get(), scope, function_call, | 101 CreateBundleTargetGenerator generator(target.get(), scope, function_call, |
| 101 err); | 102 err); |
| (...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 399 if (err_->has_error()) | 400 if (err_->has_error()) |
| 400 return false; | 401 return false; |
| 401 if (!EnsureStringIsInOutputDir(GetBuildSettings()->build_dir(), | 402 if (!EnsureStringIsInOutputDir(GetBuildSettings()->build_dir(), |
| 402 source_file.value(), value->origin(), err_)) | 403 source_file.value(), value->origin(), err_)) |
| 403 return false; | 404 return false; |
| 404 OutputFile output_file(GetBuildSettings(), source_file); | 405 OutputFile output_file(GetBuildSettings(), source_file); |
| 405 target_->set_write_runtime_deps_output(output_file); | 406 target_->set_write_runtime_deps_output(output_file); |
| 406 | 407 |
| 407 return true; | 408 return true; |
| 408 } | 409 } |
| OLD | NEW |