Add the ability to code generated prepopulated static nested structs
[chromium-blink-merge.git] / tools / gn / BUILD.gn
blob3109f758bd9c4bb68b8668d22f1863811cb0883f
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
3 # found in the LICENSE file.
5 import("//testing/test.gni")
7 defines = [ "GN_BUILD" ]
9 static_library("gn_lib") {
10   configs += [ "//build/config:precompiled_headers" ]
12   sources = [
13     "action_target_generator.cc",
14     "action_target_generator.h",
15     "action_values.cc",
16     "action_values.h",
17     "args.cc",
18     "args.h",
19     "binary_target_generator.cc",
20     "binary_target_generator.h",
21     "build_settings.cc",
22     "build_settings.h",
23     "builder.cc",
24     "builder.h",
25     "builder_record.cc",
26     "builder_record.h",
27     "c_include_iterator.cc",
28     "c_include_iterator.h",
29     "command_args.cc",
30     "command_check.cc",
31     "command_clean.cc",
32     "command_desc.cc",
33     "command_format.cc",
34     "command_gen.cc",
35     "command_help.cc",
36     "command_ls.cc",
37     "command_path.cc",
38     "command_refs.cc",
39     "commands.cc",
40     "commands.h",
41     "config.cc",
42     "config.h",
43     "config_values.cc",
44     "config_values.h",
45     "config_values_extractors.cc",
46     "config_values_extractors.h",
47     "config_values_generator.cc",
48     "config_values_generator.h",
49     "copy_target_generator.cc",
50     "copy_target_generator.h",
51     "deps_iterator.cc",
52     "deps_iterator.h",
53     "err.cc",
54     "err.h",
55     "escape.cc",
56     "escape.h",
57     "exec_process.cc",
58     "exec_process.h",
59     "filesystem_utils.cc",
60     "filesystem_utils.h",
61     "function_exec_script.cc",
62     "function_foreach.cc",
63     "function_get_label_info.cc",
64     "function_get_path_info.cc",
65     "function_get_target_outputs.cc",
66     "function_process_file_template.cc",
67     "function_read_file.cc",
68     "function_rebase_path.cc",
69     "function_set_default_toolchain.cc",
70     "function_set_defaults.cc",
71     "function_template.cc",
72     "function_toolchain.cc",
73     "function_write_file.cc",
74     "functions.cc",
75     "functions.h",
76     "functions_target.cc",
77     "group_target_generator.cc",
78     "group_target_generator.h",
79     "header_checker.cc",
80     "header_checker.h",
81     "import_manager.cc",
82     "import_manager.h",
83     "inherited_libraries.cc",
84     "inherited_libraries.h",
85     "input_conversion.cc",
86     "input_conversion.h",
87     "input_file.cc",
88     "input_file.h",
89     "input_file_manager.cc",
90     "input_file_manager.h",
91     "item.cc",
92     "item.h",
93     "label.cc",
94     "label.h",
95     "label_pattern.cc",
96     "label_pattern.h",
97     "label_ptr.h",
98     "loader.cc",
99     "loader.h",
100     "location.cc",
101     "location.h",
102     "ninja_action_target_writer.cc",
103     "ninja_action_target_writer.h",
104     "ninja_binary_target_writer.cc",
105     "ninja_binary_target_writer.h",
106     "ninja_build_writer.cc",
107     "ninja_build_writer.h",
108     "ninja_copy_target_writer.cc",
109     "ninja_copy_target_writer.h",
110     "ninja_group_target_writer.cc",
111     "ninja_group_target_writer.h",
112     "ninja_target_writer.cc",
113     "ninja_target_writer.h",
114     "ninja_toolchain_writer.cc",
115     "ninja_toolchain_writer.h",
116     "ninja_utils.cc",
117     "ninja_utils.h",
118     "ninja_writer.cc",
119     "ninja_writer.h",
120     "operators.cc",
121     "operators.h",
122     "output_file.cc",
123     "output_file.h",
124     "parse_tree.cc",
125     "parse_tree.h",
126     "parser.cc",
127     "parser.h",
128     "path_output.cc",
129     "path_output.h",
130     "pattern.cc",
131     "pattern.h",
132     "runtime_deps.cc",
133     "runtime_deps.h",
134     "scheduler.cc",
135     "scheduler.h",
136     "scope.cc",
137     "scope.h",
138     "scope_per_file_provider.cc",
139     "scope_per_file_provider.h",
140     "settings.cc",
141     "settings.h",
142     "setup.cc",
143     "setup.h",
144     "source_dir.cc",
145     "source_dir.h",
146     "source_file.cc",
147     "source_file.h",
148     "source_file_type.cc",
149     "source_file_type.h",
150     "standard_out.cc",
151     "standard_out.h",
152     "string_utils.cc",
153     "string_utils.h",
154     "substitution_list.cc",
155     "substitution_list.h",
156     "substitution_pattern.cc",
157     "substitution_pattern.h",
158     "substitution_type.cc",
159     "substitution_type.h",
160     "substitution_writer.cc",
161     "substitution_writer.h",
162     "switches.cc",
163     "switches.h",
164     "target.cc",
165     "target.h",
166     "target_generator.cc",
167     "target_generator.h",
168     "template.cc",
169     "template.h",
170     "token.cc",
171     "token.h",
172     "tokenizer.cc",
173     "tokenizer.h",
174     "tool.cc",
175     "tool.h",
176     "toolchain.cc",
177     "toolchain.h",
178     "trace.cc",
179     "trace.h",
180     "unique_vector.h",
181     "value.cc",
182     "value.h",
183     "value_extractors.cc",
184     "value_extractors.h",
185     "variables.cc",
186     "variables.h",
187     "visibility.cc",
188     "visibility.h",
189   ]
191   deps = [
192     "//base",
193     "//base/third_party/dynamic_annotations",
194   ]
197 action("last_commit_position") {
198   script = "last_commit_position.py"
200   # This dependency forces a re-run when the code is synced.
201   inputs = [
202     "//build/util/LASTCHANGE",
203   ]
205   outfile = "$target_gen_dir/last_commit_position.h"
206   outputs = [
207     outfile,
208   ]
210   args = [
211     rebase_path("//", root_build_dir),
212     rebase_path(outfile, root_build_dir),
213     "TOOLS_GN_LAST_COMMIT_POSITION_H_",
214   ]
217 executable("gn") {
218   sources = [
219     "gn_main.cc",
220   ]
222   deps = [
223     ":gn_lib",
224     ":last_commit_position",
225     "//base",
226   ]
229 test("gn_unittests") {
230   sources = [
231     "action_target_generator_unittest.cc",
232     "args_unittest.cc",
233     "builder_unittest.cc",
234     "c_include_iterator_unittest.cc",
235     "command_format_unittest.cc",
236     "config_values_extractors_unittest.cc",
237     "escape_unittest.cc",
238     "exec_process_unittest.cc",
239     "filesystem_utils_unittest.cc",
240     "function_foreach_unittest.cc",
241     "function_get_label_info_unittest.cc",
242     "function_get_path_info_unittest.cc",
243     "function_get_target_outputs_unittest.cc",
244     "function_process_file_template_unittest.cc",
245     "function_rebase_path_unittest.cc",
246     "function_write_file_unittest.cc",
247     "functions_target_unittest.cc",
248     "functions_unittest.cc",
249     "header_checker_unittest.cc",
250     "inherited_libraries_unittest.cc",
251     "input_conversion_unittest.cc",
252     "label_pattern_unittest.cc",
253     "label_unittest.cc",
254     "loader_unittest.cc",
255     "ninja_action_target_writer_unittest.cc",
256     "ninja_binary_target_writer_unittest.cc",
257     "ninja_copy_target_writer_unittest.cc",
258     "ninja_group_target_writer_unittest.cc",
259     "ninja_target_writer_unittest.cc",
260     "ninja_toolchain_writer_unittest.cc",
261     "operators_unittest.cc",
262     "parse_tree_unittest.cc",
263     "parser_unittest.cc",
264     "path_output_unittest.cc",
265     "pattern_unittest.cc",
266     "runtime_deps_unittest.cc",
267     "scope_per_file_provider_unittest.cc",
268     "scope_unittest.cc",
269     "source_dir_unittest.cc",
270     "source_file_unittest.cc",
271     "string_utils_unittest.cc",
272     "substitution_pattern_unittest.cc",
273     "substitution_writer_unittest.cc",
274     "target_generator_unittest.cc",
275     "target_unittest.cc",
276     "template_unittest.cc",
277     "test_with_scope.cc",
278     "test_with_scope.h",
279     "tokenizer_unittest.cc",
280     "unique_vector_unittest.cc",
281     "value_unittest.cc",
282     "visibility_unittest.cc",
283   ]
284   deps = [
285     ":gn_lib",
286     "//base/test:run_all_unittests",
287     "//base/test:test_support",
288     "//testing/gtest",
289   ]
292 executable("generate_test_gn_data") {
293   sources = [
294     "generate_test_gn_data.cc",
295   ]
296   deps = [
297     "//base",
298   ]