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

Side by Side Diff: tools/gn/config.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 unified diff | Download patch
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/config.h" 5 #include "tools/gn/config.h"
6 6
7 #include "tools/gn/err.h" 7 #include "tools/gn/err.h"
8 #include "tools/gn/input_file_manager.h" 8 #include "tools/gn/input_file_manager.h"
9 #include "tools/gn/scheduler.h" 9 #include "tools/gn/scheduler.h"
10 10
11 Config::Config(const Settings* settings, const Label& label) 11 Config::Config(const Settings* settings, const Label& label)
12 : Item(settings, label) { 12 : Item(settings, label),
13 resolved_(false) {
13 } 14 }
14 15
15 Config::~Config() { 16 Config::~Config() {
16 } 17 }
17 18
18 Config* Config::AsConfig() { 19 Config* Config::AsConfig() {
19 return this; 20 return this;
20 } 21 }
21 22
22 const Config* Config::AsConfig() const { 23 const Config* Config::AsConfig() const {
23 return this; 24 return this;
24 } 25 }
26
27 bool Config::OnResolved(Err* err) {
28 DCHECK(!resolved_);
29 resolved_ = true;
30
31 if (!configs_.empty()) {
32 // Nested configs, flatten.
Dirk Pranke 2015/09/15 21:31:30 As noted elsewhere, I don't like the use of "neste
33 composite_values_ = own_values_;
34 for (const auto& pair : configs_)
35 composite_values_.AppendValues(pair.ptr->resolved_values());
36 }
37 return true;
38 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698