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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 generator.Run(); | 106 generator.Run(); |
107 } else if (output_type == functions::kSourceSet) { | 107 } else if (output_type == functions::kSourceSet) { |
108 BinaryTargetGenerator generator(target.get(), scope, function_call, | 108 BinaryTargetGenerator generator(target.get(), scope, function_call, |
109 Target::SOURCE_SET, err); | 109 Target::SOURCE_SET, err); |
110 generator.Run(); | 110 generator.Run(); |
111 } else if (output_type == functions::kStaticLibrary) { | 111 } else if (output_type == functions::kStaticLibrary) { |
112 BinaryTargetGenerator generator(target.get(), scope, function_call, | 112 BinaryTargetGenerator generator(target.get(), scope, function_call, |
113 Target::STATIC_LIBRARY, err); | 113 Target::STATIC_LIBRARY, err); |
114 generator.Run(); | 114 generator.Run(); |
115 } else { | 115 } else { |
116 *err = Err(function_call, "Not a known output type", | 116 *err = Err(function_call, "Not a known target type", |
117 "I am very confused."); | 117 "I am very confused by the target type \"" + output_type + "\""); |
118 } | 118 } |
119 | 119 |
120 if (err->has_error()) | 120 if (err->has_error()) |
121 return; | 121 return; |
122 | 122 |
123 // Save this target for the file. | 123 // Save this target for the file. |
124 Scope::ItemVector* collector = scope->GetItemCollector(); | 124 Scope::ItemVector* collector = scope->GetItemCollector(); |
125 if (!collector) { | 125 if (!collector) { |
126 *err = Err(function_call, "Can't define a target in this context."); | 126 *err = Err(function_call, "Can't define a target in this context."); |
127 return; | 127 return; |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 bool TargetGenerator::FillForwardDependentConfigs() { | 369 bool TargetGenerator::FillForwardDependentConfigs() { |
370 const Value* value = scope_->GetValue( | 370 const Value* value = scope_->GetValue( |
371 variables::kForwardDependentConfigsFrom, true); | 371 variables::kForwardDependentConfigsFrom, true); |
372 if (value) { | 372 if (value) { |
373 ExtractListOfUniqueLabels(*value, scope_->GetSourceDir(), | 373 ExtractListOfUniqueLabels(*value, scope_->GetSourceDir(), |
374 ToolchainLabelForScope(scope_), | 374 ToolchainLabelForScope(scope_), |
375 &target_->forward_dependent_configs(), err_); | 375 &target_->forward_dependent_configs(), err_); |
376 } | 376 } |
377 return !err_->has_error(); | 377 return !err_->has_error(); |
378 } | 378 } |
OLD | NEW |