| 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 #ifndef TOOLS_GN_CONFIG_H_ | 5 #ifndef TOOLS_GN_CONFIG_H_ |
| 6 #define TOOLS_GN_CONFIG_H_ | 6 #define TOOLS_GN_CONFIG_H_ |
| 7 | 7 |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "tools/gn/config_values.h" | 10 #include "tools/gn/config_values.h" |
| 11 #include "tools/gn/item.h" | 11 #include "tools/gn/item.h" |
| 12 #include "tools/gn/label_ptr.h" | 12 #include "tools/gn/label_ptr.h" |
| 13 #include "tools/gn/unique_vector.h" | 13 #include "tools/gn/unique_vector.h" |
| 14 | 14 |
| 15 // Represents a named config in the dependency graph. | 15 // Represents a named config in the dependency graph. |
| 16 // | 16 // |
| 17 // A config can list other configs. We track both the data assigned directly | 17 // A config can list other configs. We track both the data assigned directly |
| 18 // on the config, this list of sub-configs, and (when the config is resolved) | 18 // on the config, this list of sub-configs, and (when the config is resolved) |
| 19 // the resulting values of everything merged together. The flatten step | 19 // the resulting values of everything merged together. The flatten step |
| 20 // means we can avoid doing a recursive config walk for every target to compute | 20 // means we can avoid doing a recursive config walk for every target to compute |
| 21 // flags. | 21 // flags. |
| 22 class Config : public Item { | 22 class Config : public Item { |
| 23 public: | 23 public: |
| 24 Config(const Settings* settings, const Label& label); | 24 Config(const Settings* settings, |
| 25 const Label& label, |
| 26 const InputFileSet& input_files); |
| 25 ~Config() override; | 27 ~Config() override; |
| 26 | 28 |
| 27 // Item implementation. | 29 // Item implementation. |
| 28 Config* AsConfig() override; | 30 Config* AsConfig() override; |
| 29 const Config* AsConfig() const override; | 31 const Config* AsConfig() const override; |
| 30 bool OnResolved(Err* err) override; | 32 bool OnResolved(Err* err) override; |
| 31 | 33 |
| 32 // The values set directly on this config. This will not contain data from | 34 // The values set directly on this config. This will not contain data from |
| 33 // sub-configs. | 35 // sub-configs. |
| 34 ConfigValues& own_values() { return own_values_; } | 36 ConfigValues& own_values() { return own_values_; } |
| (...skipping 21 matching lines...) Expand all Loading... |
| 56 // items in configs_. The resolved_values() getter handles this. | 58 // items in configs_. The resolved_values() getter handles this. |
| 57 bool resolved_; | 59 bool resolved_; |
| 58 ConfigValues composite_values_; | 60 ConfigValues composite_values_; |
| 59 | 61 |
| 60 UniqueVector<LabelConfigPair> configs_; | 62 UniqueVector<LabelConfigPair> configs_; |
| 61 | 63 |
| 62 DISALLOW_COPY_AND_ASSIGN(Config); | 64 DISALLOW_COPY_AND_ASSIGN(Config); |
| 63 }; | 65 }; |
| 64 | 66 |
| 65 #endif // TOOLS_GN_CONFIG_H_ | 67 #endif // TOOLS_GN_CONFIG_H_ |
| OLD | NEW |