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/config_values_generator.h" | 5 #include "tools/gn/config_values_generator.h" |
6 | 6 |
7 #include "tools/gn/config_values.h" | 7 #include "tools/gn/config_values.h" |
8 #include "tools/gn/scope.h" | 8 #include "tools/gn/scope.h" |
9 #include "tools/gn/settings.h" | 9 #include "tools/gn/settings.h" |
10 #include "tools/gn/value.h" | 10 #include "tools/gn/value.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 return; // No value, empty input and succeed. | 40 return; // No value, empty input and succeed. |
41 | 41 |
42 std::vector<SourceDir> result; | 42 std::vector<SourceDir> result; |
43 ExtractListOfRelativeDirs(scope->settings()->build_settings(), | 43 ExtractListOfRelativeDirs(scope->settings()->build_settings(), |
44 *value, input_dir, &result, err); | 44 *value, input_dir, &result, err); |
45 (config_values->*accessor)().swap(result); | 45 (config_values->*accessor)().swap(result); |
46 } | 46 } |
47 | 47 |
48 } // namespace | 48 } // namespace |
49 | 49 |
50 ConfigValuesGenerator::ConfigValuesGenerator(ConfigValues* dest_values, | 50 ConfigValuesGenerator::ConfigValuesGenerator( |
51 Scope* scope, | 51 ConfigValues* dest_values, |
52 const Token& function_token, | 52 Scope* scope, |
53 const SourceDir& input_dir, | 53 const SourceDir& input_dir, |
54 Err* err) | 54 Err* err) |
55 : config_values_(dest_values), | 55 : config_values_(dest_values), |
56 scope_(scope), | 56 scope_(scope), |
57 function_token_(function_token), | |
58 input_dir_(input_dir), | 57 input_dir_(input_dir), |
59 err_(err) { | 58 err_(err) { |
60 } | 59 } |
61 | 60 |
62 ConfigValuesGenerator::~ConfigValuesGenerator() { | 61 ConfigValuesGenerator::~ConfigValuesGenerator() { |
63 } | 62 } |
64 | 63 |
65 void ConfigValuesGenerator::Run() { | 64 void ConfigValuesGenerator::Run() { |
66 #define FILL_STRING_CONFIG_VALUE(name) \ | 65 #define FILL_STRING_CONFIG_VALUE(name) \ |
67 GetStringList(scope_, #name, config_values_, &ConfigValues::name, err_); | 66 GetStringList(scope_, #name, config_values_, &ConfigValues::name, err_); |
68 #define FILL_DIR_CONFIG_VALUE(name) \ | 67 #define FILL_DIR_CONFIG_VALUE(name) \ |
69 GetDirList(scope_, #name, config_values_, input_dir_, \ | 68 GetDirList(scope_, #name, config_values_, input_dir_, \ |
70 &ConfigValues::name, err_); | 69 &ConfigValues::name, err_); |
71 | 70 |
72 FILL_STRING_CONFIG_VALUE(cflags) | 71 FILL_STRING_CONFIG_VALUE(cflags) |
73 FILL_STRING_CONFIG_VALUE(cflags_c) | 72 FILL_STRING_CONFIG_VALUE(cflags_c) |
74 FILL_STRING_CONFIG_VALUE(cflags_cc) | 73 FILL_STRING_CONFIG_VALUE(cflags_cc) |
75 FILL_STRING_CONFIG_VALUE(cflags_objc) | 74 FILL_STRING_CONFIG_VALUE(cflags_objc) |
76 FILL_STRING_CONFIG_VALUE(cflags_objcc) | 75 FILL_STRING_CONFIG_VALUE(cflags_objcc) |
77 FILL_STRING_CONFIG_VALUE(defines) | 76 FILL_STRING_CONFIG_VALUE(defines) |
78 FILL_DIR_CONFIG_VALUE( include_dirs) | 77 FILL_DIR_CONFIG_VALUE( include_dirs) |
79 FILL_STRING_CONFIG_VALUE(ldflags) | 78 FILL_STRING_CONFIG_VALUE(ldflags) |
80 FILL_DIR_CONFIG_VALUE( lib_dirs) | 79 FILL_DIR_CONFIG_VALUE( lib_dirs) |
81 FILL_STRING_CONFIG_VALUE(libs) | 80 FILL_STRING_CONFIG_VALUE(libs) |
82 | 81 |
83 #undef FILL_STRING_CONFIG_VALUE | 82 #undef FILL_STRING_CONFIG_VALUE |
84 #undef FILL_DIR_CONFIG_VALUE | 83 #undef FILL_DIR_CONFIG_VALUE |
85 } | 84 } |
OLD | NEW |