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

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

Issue 46313003: Implement target visibility in GN (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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
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/err.h" 5 #include "tools/gn/err.h"
6 #include "tools/gn/functions.h" 6 #include "tools/gn/functions.h"
7 #include "tools/gn/parse_tree.h" 7 #include "tools/gn/parse_tree.h"
8 #include "tools/gn/scheduler.h" 8 #include "tools/gn/scheduler.h"
9 #include "tools/gn/scope.h" 9 #include "tools/gn/scope.h"
10 #include "tools/gn/settings.h" 10 #include "tools/gn/settings.h"
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 // have toolchain names. 98 // have toolchain names.
99 const SourceDir& input_dir = scope->GetSourceDir(); 99 const SourceDir& input_dir = scope->GetSourceDir();
100 Label label(input_dir, args[0].string_value()); 100 Label label(input_dir, args[0].string_value());
101 if (g_scheduler->verbose_logging()) 101 if (g_scheduler->verbose_logging())
102 g_scheduler->Log("Definining toolchain", label.GetUserVisibleName(false)); 102 g_scheduler->Log("Definining toolchain", label.GetUserVisibleName(false));
103 103
104 // This object will actually be copied into the one owned by the toolchain 104 // This object will actually be copied into the one owned by the toolchain
105 // manager, but that has to be done in the lock. 105 // manager, but that has to be done in the lock.
106 scoped_ptr<Toolchain> toolchain(new Toolchain(scope->settings(), label)); 106 scoped_ptr<Toolchain> toolchain(new Toolchain(scope->settings(), label));
107 toolchain->set_defined_from(function); 107 toolchain->set_defined_from(function);
108 toolchain->visibility().SetPublic();
108 109
109 Scope block_scope(scope); 110 Scope block_scope(scope);
110 block_scope.SetProperty(&kToolchainPropertyKey, toolchain.get()); 111 block_scope.SetProperty(&kToolchainPropertyKey, toolchain.get());
111 block->ExecuteBlockInScope(&block_scope, err); 112 block->ExecuteBlockInScope(&block_scope, err);
112 block_scope.SetProperty(&kToolchainPropertyKey, NULL); 113 block_scope.SetProperty(&kToolchainPropertyKey, NULL);
113 if (err->has_error()) 114 if (err->has_error())
114 return Value(); 115 return Value();
115 116
116 if (!block_scope.CheckForUnusedVars(err)) 117 if (!block_scope.CheckForUnusedVars(err))
117 return Value(); 118 return Value();
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 return Value(); 295 return Value();
295 296
296 Scope::KeyValueMap values; 297 Scope::KeyValueMap values;
297 block_scope.GetCurrentScopeValues(&values); 298 block_scope.GetCurrentScopeValues(&values);
298 toolchain->args() = values; 299 toolchain->args() = values;
299 300
300 return Value(); 301 return Value();
301 } 302 }
302 303
303 } // namespace functions 304 } // namespace functions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698