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

Unified Diff: tools/gn/functions.cc

Issue 1342183003: Allow GN configs to have sub-configs. (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/gn/config_values_extractors_unittest.cc ('k') | tools/gn/gn.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/functions.cc
diff --git a/tools/gn/functions.cc b/tools/gn/functions.cc
index 71d05aa04e2066ebf0706b4259b520fec4b80be0..86043f0a73ab930c5c00fd28832e434b7a208331 100644
--- a/tools/gn/functions.cc
+++ b/tools/gn/functions.cc
@@ -19,6 +19,8 @@
#include "tools/gn/template.h"
#include "tools/gn/token.h"
#include "tools/gn/value.h"
+#include "tools/gn/value_extractors.h"
+#include "tools/gn/variables.h"
namespace {
@@ -299,13 +301,23 @@ Value RunConfig(const FunctionCallNode* function,
if (!Visibility::FillItemVisibility(config.get(), scope, err))
return Value();
- // Fill it.
+ // Fill the flags and such.
const SourceDir& input_dir = scope->GetSourceDir();
- ConfigValuesGenerator gen(&config->config_values(), scope, input_dir, err);
+ ConfigValuesGenerator gen(&config->own_values(), scope, input_dir, err);
gen.Run();
if (err->has_error())
return Value();
+ // Read sub-configs.
+ const Value* configs_value = scope->GetValue(variables::kConfigs, true);
+ if (configs_value) {
+ ExtractListOfUniqueLabels(*configs_value, scope->GetSourceDir(),
+ ToolchainLabelForScope(scope),
+ &config->configs(), err);
+ }
+ if (err->has_error())
+ return Value();
+
// Save the generated item.
Scope::ItemVector* collector = scope->GetItemCollector();
if (!collector) {
« no previous file with comments | « tools/gn/config_values_extractors_unittest.cc ('k') | tools/gn/gn.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698