| 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/functions.h" | 5 #include "tools/gn/functions.h" |
| 6 | 6 |
| 7 #include <iostream> | 7 #include <iostream> |
| 8 | 8 |
| 9 #include "base/environment.h" | 9 #include "base/environment.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 return Value(); | 226 return Value(); |
| 227 | 227 |
| 228 Label label(MakeLabelForScope(scope, function, args[0].string_value())); | 228 Label label(MakeLabelForScope(scope, function, args[0].string_value())); |
| 229 | 229 |
| 230 if (g_scheduler->verbose_logging()) | 230 if (g_scheduler->verbose_logging()) |
| 231 g_scheduler->Log("Defining config", label.GetUserVisibleName(true)); | 231 g_scheduler->Log("Defining config", label.GetUserVisibleName(true)); |
| 232 | 232 |
| 233 // Create the new config. | 233 // Create the new config. |
| 234 scoped_ptr<Config> config(new Config(scope->settings(), label)); | 234 scoped_ptr<Config> config(new Config(scope->settings(), label)); |
| 235 config->set_defined_from(function); | 235 config->set_defined_from(function); |
| 236 if (!Visibility::FillItemVisibility(config.get(), scope, err)) |
| 237 return Value(); |
| 236 | 238 |
| 237 // Fill it. | 239 // Fill it. |
| 238 const SourceDir& input_dir = scope->GetSourceDir(); | 240 const SourceDir& input_dir = scope->GetSourceDir(); |
| 239 ConfigValuesGenerator gen(&config->config_values(), scope, input_dir, err); | 241 ConfigValuesGenerator gen(&config->config_values(), scope, input_dir, err); |
| 240 gen.Run(); | 242 gen.Run(); |
| 241 if (err->has_error()) | 243 if (err->has_error()) |
| 242 return Value(); | 244 return Value(); |
| 243 | 245 |
| 244 // Mark as complete. | 246 // Mark as complete. |
| 245 scope->settings()->build_settings()->ItemDefined(config.PassAs<Item>()); | 247 scope->settings()->build_settings()->ItemDefined(config.PassAs<Item>()); |
| (...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 715 return found_function->second.executed_block_runner( | 717 return found_function->second.executed_block_runner( |
| 716 function, args.list_value(), &block_scope, err); | 718 function, args.list_value(), &block_scope, err); |
| 717 } | 719 } |
| 718 | 720 |
| 719 // Otherwise it's a no-block function. | 721 // Otherwise it's a no-block function. |
| 720 return found_function->second.no_block_runner(scope, function, | 722 return found_function->second.no_block_runner(scope, function, |
| 721 args.list_value(), err); | 723 args.list_value(), err); |
| 722 } | 724 } |
| 723 | 725 |
| 724 } // namespace functions | 726 } // namespace functions |
| OLD | NEW |