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

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

Issue 1314773005: Throw errors for nested targets in GN. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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
« no previous file with comments | « tools/gn/function_template.cc ('k') | tools/gn/functions.h » ('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 <algorithm> 5 #include <algorithm>
6 #include <limits> 6 #include <limits>
7 7
8 #include "tools/gn/err.h" 8 #include "tools/gn/err.h"
9 #include "tools/gn/functions.h" 9 #include "tools/gn/functions.h"
10 #include "tools/gn/parse_tree.h" 10 #include "tools/gn/parse_tree.h"
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 " is_32bit = true\n" 294 " is_32bit = true\n"
295 " is_64bit = false\n" 295 " is_64bit = false\n"
296 " }\n" 296 " }\n"
297 " }\n"; 297 " }\n";
298 298
299 Value RunToolchain(Scope* scope, 299 Value RunToolchain(Scope* scope,
300 const FunctionCallNode* function, 300 const FunctionCallNode* function,
301 const std::vector<Value>& args, 301 const std::vector<Value>& args,
302 BlockNode* block, 302 BlockNode* block,
303 Err* err) { 303 Err* err) {
304 NonNestableBlock non_nestable(scope, function, "toolchain");
305 if (!non_nestable.Enter(err))
306 return Value();
307
304 if (!EnsureNotProcessingImport(function, scope, err) || 308 if (!EnsureNotProcessingImport(function, scope, err) ||
305 !EnsureNotProcessingBuildConfig(function, scope, err)) 309 !EnsureNotProcessingBuildConfig(function, scope, err))
306 return Value(); 310 return Value();
307 311
308 // Note that we don't want to use MakeLabelForScope since that will include 312 // Note that we don't want to use MakeLabelForScope since that will include
309 // the toolchain name in the label, and toolchain labels don't themselves 313 // the toolchain name in the label, and toolchain labels don't themselves
310 // have toolchain names. 314 // have toolchain names.
311 const SourceDir& input_dir = scope->GetSourceDir(); 315 const SourceDir& input_dir = scope->GetSourceDir();
312 Label label(input_dir, args[0].string_value()); 316 Label label(input_dir, args[0].string_value());
313 if (g_scheduler->verbose_logging()) 317 if (g_scheduler->verbose_logging())
(...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after
945 return Value(); 949 return Value();
946 950
947 Scope::KeyValueMap values; 951 Scope::KeyValueMap values;
948 block_scope.GetCurrentScopeValues(&values); 952 block_scope.GetCurrentScopeValues(&values);
949 toolchain->args() = values; 953 toolchain->args() = values;
950 954
951 return Value(); 955 return Value();
952 } 956 }
953 957
954 } // namespace functions 958 } // namespace functions
OLDNEW
« no previous file with comments | « tools/gn/function_template.cc ('k') | tools/gn/functions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698