exclude PluginsFieldTrialTest.NoPrefLeftBehind from valgrind bot
[chromium-blink-merge.git] / tools / gn / BUILD.gn
blobcdf6e631ea361dac0343b9d7a5e767dd23fb9f58
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_forward_variables_from.cc",
64     "function_get_label_info.cc",
65     "function_get_path_info.cc",
66     "function_get_target_outputs.cc",
67     "function_process_file_template.cc",
68     "function_read_file.cc",
69     "function_rebase_path.cc",
70     "function_set_default_toolchain.cc",
71     "function_set_defaults.cc",
72     "function_template.cc",
73     "function_toolchain.cc",
74     "function_write_file.cc",
75     "functions.cc",
76     "functions.h",
77     "functions_target.cc",
78     "group_target_generator.cc",
79     "group_target_generator.h",
80     "header_checker.cc",
81     "header_checker.h",
82     "import_manager.cc",
83     "import_manager.h",
84     "inherited_libraries.cc",
85     "inherited_libraries.h",
86     "input_conversion.cc",
87     "input_conversion.h",
88     "input_file.cc",
89     "input_file.h",
90     "input_file_manager.cc",
91     "input_file_manager.h",
92     "item.cc",
93     "item.h",
94     "label.cc",
95     "label.h",
96     "label_pattern.cc",
97     "label_pattern.h",
98     "label_ptr.h",
99     "loader.cc",
100     "loader.h",
101     "location.cc",
102     "location.h",
103     "ninja_action_target_writer.cc",
104     "ninja_action_target_writer.h",
105     "ninja_binary_target_writer.cc",
106     "ninja_binary_target_writer.h",
107     "ninja_build_writer.cc",
108     "ninja_build_writer.h",
109     "ninja_copy_target_writer.cc",
110     "ninja_copy_target_writer.h",
111     "ninja_group_target_writer.cc",
112     "ninja_group_target_writer.h",
113     "ninja_target_writer.cc",
114     "ninja_target_writer.h",
115     "ninja_toolchain_writer.cc",
116     "ninja_toolchain_writer.h",
117     "ninja_utils.cc",
118     "ninja_utils.h",
119     "ninja_writer.cc",
120     "ninja_writer.h",
121     "operators.cc",
122     "operators.h",
123     "output_file.cc",
124     "output_file.h",
125     "parse_tree.cc",
126     "parse_tree.h",
127     "parser.cc",
128     "parser.h",
129     "path_output.cc",
130     "path_output.h",
131     "pattern.cc",
132     "pattern.h",
133     "runtime_deps.cc",
134     "runtime_deps.h",
135     "scheduler.cc",
136     "scheduler.h",
137     "scope.cc",
138     "scope.h",
139     "scope_per_file_provider.cc",
140     "scope_per_file_provider.h",
141     "settings.cc",
142     "settings.h",
143     "setup.cc",
144     "setup.h",
145     "source_dir.cc",
146     "source_dir.h",
147     "source_file.cc",
148     "source_file.h",
149     "source_file_type.cc",
150     "source_file_type.h",
151     "standard_out.cc",
152     "standard_out.h",
153     "string_utils.cc",
154     "string_utils.h",
155     "substitution_list.cc",
156     "substitution_list.h",
157     "substitution_pattern.cc",
158     "substitution_pattern.h",
159     "substitution_type.cc",
160     "substitution_type.h",
161     "substitution_writer.cc",
162     "substitution_writer.h",
163     "switches.cc",
164     "switches.h",
165     "target.cc",
166     "target.h",
167     "target_generator.cc",
168     "target_generator.h",
169     "template.cc",
170     "template.h",
171     "token.cc",
172     "token.h",
173     "tokenizer.cc",
174     "tokenizer.h",
175     "tool.cc",
176     "tool.h",
177     "toolchain.cc",
178     "toolchain.h",
179     "trace.cc",
180     "trace.h",
181     "unique_vector.h",
182     "value.cc",
183     "value.h",
184     "value_extractors.cc",
185     "value_extractors.h",
186     "variables.cc",
187     "variables.h",
188     "visibility.cc",
189     "visibility.h",
190   ]
192   deps = [
193     "//base",
194     "//base/third_party/dynamic_annotations",
195   ]
198 action("last_commit_position") {
199   script = "last_commit_position.py"
201   # This dependency forces a re-run when the code is synced.
202   inputs = [
203     "//build/util/LASTCHANGE",
204   ]
206   outfile = "$target_gen_dir/last_commit_position.h"
207   outputs = [
208     outfile,
209   ]
211   args = [
212     rebase_path("//", root_build_dir),
213     rebase_path(outfile, root_build_dir),
214     "TOOLS_GN_LAST_COMMIT_POSITION_H_",
215   ]
218 # Note for Windows debugging: GN is super-multithreaded and uses a lot of STL.
219 # Iterator debugging on Windows does locking for every access, which ends up
220 # slowing down debug runtime from 0:36 to 9:40. If you want to run debug builds
221 # of GN over the large Chrome build, you will want to set the arg:
222 #   enable_iterator_debugging = false
223 executable("gn") {
224   sources = [
225     "gn_main.cc",
226   ]
228   deps = [
229     ":gn_lib",
230     ":last_commit_position",
231     "//base",
232   ]
235 # TODO(GYP): Delete this after we've converted everything to GN.
236 # The _run targets exist only for compatibility w/ GYP.
237 group("gn_unittests_run") {
238   testonly = true
239   deps = [
240     ":gn_unittests",
241   ]
244 test("gn_unittests") {
245   sources = [
246     "action_target_generator_unittest.cc",
247     "args_unittest.cc",
248     "builder_unittest.cc",
249     "c_include_iterator_unittest.cc",
250     "command_format_unittest.cc",
251     "config_values_extractors_unittest.cc",
252     "escape_unittest.cc",
253     "exec_process_unittest.cc",
254     "filesystem_utils_unittest.cc",
255     "function_foreach_unittest.cc",
256     "function_forward_variables_from_unittest.cc",
257     "function_get_label_info_unittest.cc",
258     "function_get_path_info_unittest.cc",
259     "function_get_target_outputs_unittest.cc",
260     "function_process_file_template_unittest.cc",
261     "function_rebase_path_unittest.cc",
262     "function_write_file_unittest.cc",
263     "functions_target_unittest.cc",
264     "functions_unittest.cc",
265     "header_checker_unittest.cc",
266     "inherited_libraries_unittest.cc",
267     "input_conversion_unittest.cc",
268     "label_pattern_unittest.cc",
269     "label_unittest.cc",
270     "loader_unittest.cc",
271     "ninja_action_target_writer_unittest.cc",
272     "ninja_binary_target_writer_unittest.cc",
273     "ninja_copy_target_writer_unittest.cc",
274     "ninja_group_target_writer_unittest.cc",
275     "ninja_target_writer_unittest.cc",
276     "ninja_toolchain_writer_unittest.cc",
277     "operators_unittest.cc",
278     "parse_tree_unittest.cc",
279     "parser_unittest.cc",
280     "path_output_unittest.cc",
281     "pattern_unittest.cc",
282     "runtime_deps_unittest.cc",
283     "scope_per_file_provider_unittest.cc",
284     "scope_unittest.cc",
285     "source_dir_unittest.cc",
286     "source_file_unittest.cc",
287     "string_utils_unittest.cc",
288     "substitution_pattern_unittest.cc",
289     "substitution_writer_unittest.cc",
290     "target_generator_unittest.cc",
291     "target_unittest.cc",
292     "template_unittest.cc",
293     "test_with_scope.cc",
294     "test_with_scope.h",
295     "tokenizer_unittest.cc",
296     "unique_vector_unittest.cc",
297     "value_unittest.cc",
298     "visibility_unittest.cc",
299   ]
301   data = [
302     "format_test_data/",
303   ]
305   deps = [
306     ":gn_lib",
307     "//base/test:run_all_unittests",
308     "//base/test:test_support",
309     "//testing/gtest",
310   ]
313 executable("generate_test_gn_data") {
314   sources = [
315     "generate_test_gn_data.cc",
316   ]
317   deps = [
318     "//base",
319   ]