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 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 if (pattern.ranges().empty()) { | 257 if (pattern.ranges().empty()) { |
258 // Pattern is empty, error out (this prevents weirdness below). | 258 // Pattern is empty, error out (this prevents weirdness below). |
259 *err_ = Err(original_value, "This has an empty value in it."); | 259 *err_ = Err(original_value, "This has an empty value in it."); |
260 return false; | 260 return false; |
261 } | 261 } |
262 | 262 |
263 if (pattern.ranges()[0].type == SUBSTITUTION_LITERAL) { | 263 if (pattern.ranges()[0].type == SUBSTITUTION_LITERAL) { |
264 // If the first thing is a literal, it must start with the output dir. | 264 // If the first thing is a literal, it must start with the output dir. |
265 if (!EnsureStringIsInOutputDir( | 265 if (!EnsureStringIsInOutputDir( |
266 GetBuildSettings()->build_dir(), | 266 GetBuildSettings()->build_dir(), |
267 pattern.ranges()[0].literal, original_value, err_)) | 267 pattern.ranges()[0].literal, original_value.origin(), err_)) |
268 return false; | 268 return false; |
269 } else { | 269 } else { |
270 // Otherwise, the first subrange must be a pattern that expands to | 270 // Otherwise, the first subrange must be a pattern that expands to |
271 // something in the output directory. | 271 // something in the output directory. |
272 if (!SubstitutionIsInOutputDir(pattern.ranges()[0].type)) { | 272 if (!SubstitutionIsInOutputDir(pattern.ranges()[0].type)) { |
273 *err_ = Err(original_value, | 273 *err_ = Err(original_value, |
274 "File is not inside output directory.", | 274 "File is not inside output directory.", |
275 "The given file should be in the output directory. Normally you\n" | 275 "The given file should be in the output directory. Normally you\n" |
276 "would specify\n\"$target_out_dir/foo\" or " | 276 "would specify\n\"$target_out_dir/foo\" or " |
277 "\"{{source_gen_dir}}/foo\"."); | 277 "\"{{source_gen_dir}}/foo\"."); |
(...skipping 24 matching lines...) Expand all Loading... |
302 | 302 |
303 void TargetGenerator::FillForwardDependentConfigs() { | 303 void TargetGenerator::FillForwardDependentConfigs() { |
304 const Value* value = scope_->GetValue( | 304 const Value* value = scope_->GetValue( |
305 variables::kForwardDependentConfigsFrom, true); | 305 variables::kForwardDependentConfigsFrom, true); |
306 if (value) { | 306 if (value) { |
307 ExtractListOfUniqueLabels(*value, scope_->GetSourceDir(), | 307 ExtractListOfUniqueLabels(*value, scope_->GetSourceDir(), |
308 ToolchainLabelForScope(scope_), | 308 ToolchainLabelForScope(scope_), |
309 &target_->forward_dependent_configs(), err_); | 309 &target_->forward_dependent_configs(), err_); |
310 } | 310 } |
311 } | 311 } |
OLD | NEW |