Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(55)

Side by Side Diff: tools/gn/target_generator.cc

Issue 440333002: Support more configurability in GN toolchains (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: unsigned check Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tools/gn/target.cc ('k') | tools/gn/target_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « tools/gn/target.cc ('k') | tools/gn/target_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698