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_VALUES_GENERATOR_H_ | 5 #ifndef TOOLS_GN_CONFIG_VALUES_GENERATOR_H_ |
6 #define TOOLS_GN_CONFIG_VALUES_GENERATOR_H_ | 6 #define TOOLS_GN_CONFIG_VALUES_GENERATOR_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "tools/gn/source_dir.h" | 12 #include "tools/gn/source_dir.h" |
13 | 13 |
14 class ConfigValues; | 14 class ConfigValues; |
15 class Err; | 15 class Err; |
16 class Scope; | 16 class Scope; |
17 class Token; | 17 class Token; |
18 | 18 |
| 19 // This class fills in the config values from a given scope. It's shared |
| 20 // between the "config" function call and all the different binary target types |
| 21 // (shared library, static library, etc.) since all of these support the |
| 22 // various flags stored in the ConfigValues class. |
19 class ConfigValuesGenerator { | 23 class ConfigValuesGenerator { |
20 public: | 24 public: |
21 ConfigValuesGenerator(ConfigValues* dest_values, | 25 ConfigValuesGenerator(ConfigValues* dest_values, |
22 Scope* scope, | 26 Scope* scope, |
23 const Token& function_token, | |
24 const SourceDir& input_dir, | 27 const SourceDir& input_dir, |
25 Err* err); | 28 Err* err); |
26 ~ConfigValuesGenerator(); | 29 ~ConfigValuesGenerator(); |
27 | 30 |
28 // Sets the error passed to the constructor on failure. | 31 // Sets the error passed to the constructor on failure. |
29 void Run(); | 32 void Run(); |
30 | 33 |
31 private: | 34 private: |
32 ConfigValues* config_values_; | 35 ConfigValues* config_values_; |
33 Scope* scope_; | 36 Scope* scope_; |
34 const Token& function_token_; | |
35 const SourceDir input_dir_; | 37 const SourceDir input_dir_; |
36 Err* err_; | 38 Err* err_; |
37 | 39 |
38 DISALLOW_COPY_AND_ASSIGN(ConfigValuesGenerator); | 40 DISALLOW_COPY_AND_ASSIGN(ConfigValuesGenerator); |
39 }; | 41 }; |
40 | 42 |
41 // For using in documentation for functions which use this. | 43 // For using in documentation for functions which use this. |
42 #define CONFIG_VALUES_VARS_HELP \ | 44 #define CONFIG_VALUES_VARS_HELP \ |
43 " Flags: cflags, cflags_c, cflags_cc, cflags_objc, cflags_objcc,\n" \ | 45 " Flags: cflags, cflags_c, cflags_cc, cflags_objc, cflags_objcc,\n" \ |
44 " defines, include_dirs, ldflags, lib_dirs, libs\n" | 46 " defines, include_dirs, ldflags, lib_dirs, libs\n" |
45 | 47 |
46 #endif // TOOLS_GN_CONFIG_VALUES_GENERATOR_H_ | 48 #endif // TOOLS_GN_CONFIG_VALUES_GENERATOR_H_ |
OLD | NEW |