blob: 1461a79d43eab108e70c94dd232f6ff633bebccb [file] [log] [blame]
[email protected]e3730f812013-10-16 16:46:141# 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.
4
qsrfb5251d12015-01-21 15:57:225import("//testing/test.gni")
thakise47a47632016-08-24 18:19:496import("//testing/libfuzzer/fuzzer_test.gni")
qsrfb5251d12015-01-21 15:57:227
[email protected]15393202014-03-27 21:08:358defines = [ "GN_BUILD" ]
[email protected]9af0b832013-11-08 20:31:139
[email protected]ceb18412013-07-31 19:17:5810static_library("gn_lib") {
brettw3dab5fe2015-06-29 23:00:1511 configs += [ "//build/config:precompiled_headers" ]
12
[email protected]ceb18412013-07-31 19:17:5813 sources = [
[email protected]2fbe1012014-03-20 17:59:1514 "action_target_generator.cc",
15 "action_target_generator.h",
16 "action_values.cc",
17 "action_values.h",
dpranke6d8fdaa2016-08-30 03:37:4018 "analyzer.cc",
19 "analyzer.h",
[email protected]60749e1c2013-08-19 21:11:0520 "args.cc",
21 "args.h",
[email protected]c0822d7f2013-08-13 17:10:5622 "binary_target_generator.cc",
23 "binary_target_generator.h",
[email protected]ceb18412013-07-31 19:17:5824 "build_settings.cc",
25 "build_settings.h",
[email protected]26542b02013-11-08 23:25:0426 "builder.cc",
27 "builder.h",
28 "builder_record.cc",
29 "builder_record.h",
sdefresne1232aae2016-03-10 20:16:3630 "bundle_data.cc",
31 "bundle_data.h",
sdefresnedb6b992c2016-03-04 16:32:1932 "bundle_data_target_generator.cc",
33 "bundle_data_target_generator.h",
sdefresne1232aae2016-03-10 20:16:3634 "bundle_file_rule.cc",
35 "bundle_file_rule.h",
[email protected]126d8b52014-04-07 22:17:3536 "c_include_iterator.cc",
37 "c_include_iterator.h",
dpranke6d8fdaa2016-08-30 03:37:4038 "command_analyze.cc",
[email protected]60749e1c2013-08-19 21:11:0539 "command_args.cc",
[email protected]126d8b52014-04-07 22:17:3540 "command_check.cc",
tfarina7ad21662015-02-17 22:17:3341 "command_clean.cc",
[email protected]ceb18412013-07-31 19:17:5842 "command_desc.cc",
scottmg2dd93e8b2014-09-26 04:07:0543 "command_format.cc",
tfarina7ad21662015-02-17 22:17:3344 "command_gen.cc",
[email protected]ceb18412013-07-31 19:17:5845 "command_help.cc",
brettw3741b722014-08-29 17:07:2046 "command_ls.cc",
brettw14769fd2015-05-19 22:22:2847 "command_path.cc",
[email protected]60749e1c2013-08-19 21:11:0548 "command_refs.cc",
[email protected]93c19fd22013-08-06 19:34:4449 "commands.cc",
50 "commands.h",
[email protected]ceb18412013-07-31 19:17:5851 "config.cc",
52 "config.h",
[email protected]93c19fd22013-08-06 19:34:4453 "config_values.cc",
[email protected]ceb18412013-07-31 19:17:5854 "config_values.h",
55 "config_values_extractors.cc",
56 "config_values_extractors.h",
57 "config_values_generator.cc",
58 "config_values_generator.h",
[email protected]c0822d7f2013-08-13 17:10:5659 "copy_target_generator.cc",
60 "copy_target_generator.h",
sdefresne1232aae2016-03-10 20:16:3661 "create_bundle_target_generator.cc",
62 "create_bundle_target_generator.h",
brettwc2e821a32014-09-17 01:07:1463 "deps_iterator.cc",
64 "deps_iterator.h",
dpranke05316e02016-07-19 00:45:1865 "desc_builder.cc",
66 "desc_builder.h",
pkotwicz19ca979d2016-02-19 19:39:4567 "eclipse_writer.cc",
68 "eclipse_writer.h",
[email protected]ceb18412013-07-31 19:17:5869 "err.cc",
70 "err.h",
71 "escape.cc",
72 "escape.h",
cjhopman55793012014-10-16 19:19:4073 "exec_process.cc",
74 "exec_process.h",
[email protected]ceb18412013-07-31 19:17:5875 "filesystem_utils.cc",
76 "filesystem_utils.h",
[email protected]ceb18412013-07-31 19:17:5877 "function_exec_script.cc",
[email protected]92cafe52014-05-13 19:42:2578 "function_foreach.cc",
brettwdc957e1a2015-08-03 21:54:3679 "function_forward_variables_from.cc",
[email protected]7380ca72014-05-13 16:56:2080 "function_get_label_info.cc",
[email protected]01bd79b2014-06-05 17:36:2581 "function_get_path_info.cc",
[email protected]e1bd79f2014-05-05 20:27:5382 "function_get_target_outputs.cc",
[email protected]ceb18412013-07-31 19:17:5883 "function_process_file_template.cc",
84 "function_read_file.cc",
[email protected]ea3690c2013-09-23 17:59:2285 "function_rebase_path.cc",
[email protected]ceb18412013-07-31 19:17:5886 "function_set_default_toolchain.cc",
[email protected]6b4ee782013-08-20 17:13:2487 "function_set_defaults.cc",
[email protected]ceb18412013-07-31 19:17:5888 "function_template.cc",
89 "function_toolchain.cc",
90 "function_write_file.cc",
scottmg7c7296f42015-02-28 02:23:0991 "functions.cc",
92 "functions.h",
93 "functions_target.cc",
[email protected]c0822d7f2013-08-13 17:10:5694 "group_target_generator.cc",
95 "group_target_generator.h",
[email protected]126d8b52014-04-07 22:17:3596 "header_checker.cc",
97 "header_checker.h",
[email protected]ceb18412013-07-31 19:17:5898 "import_manager.cc",
99 "import_manager.h",
brettw54d767532015-04-16 17:40:49100 "inherited_libraries.cc",
101 "inherited_libraries.h",
[email protected]ceb18412013-07-31 19:17:58102 "input_conversion.cc",
103 "input_conversion.h",
104 "input_file.cc",
105 "input_file.h",
106 "input_file_manager.cc",
107 "input_file_manager.h",
108 "item.cc",
109 "item.h",
dpranke05316e02016-07-19 00:45:18110 "json_project_writer.cc",
111 "json_project_writer.h",
[email protected]ceb18412013-07-31 19:17:58112 "label.cc",
113 "label.h",
brettw3741b722014-08-29 17:07:20114 "label_pattern.cc",
115 "label_pattern.h",
[email protected]68d1dd32013-11-01 21:59:51116 "label_ptr.h",
agrievef865ab8f2015-12-22 03:04:02117 "lib_file.cc",
118 "lib_file.h",
[email protected]26542b02013-11-08 23:25:04119 "loader.cc",
120 "loader.h",
[email protected]b0d3ad5d2013-09-16 23:31:36121 "location.cc",
[email protected]ceb18412013-07-31 19:17:58122 "location.h",
[email protected]2fbe1012014-03-20 17:59:15123 "ninja_action_target_writer.cc",
124 "ninja_action_target_writer.h",
[email protected]c0822d7f2013-08-13 17:10:56125 "ninja_binary_target_writer.cc",
126 "ninja_binary_target_writer.h",
[email protected]ceb18412013-07-31 19:17:58127 "ninja_build_writer.cc",
128 "ninja_build_writer.h",
sdefresnedb6b992c2016-03-04 16:32:19129 "ninja_bundle_data_target_writer.cc",
130 "ninja_bundle_data_target_writer.h",
[email protected]c0822d7f2013-08-13 17:10:56131 "ninja_copy_target_writer.cc",
132 "ninja_copy_target_writer.h",
sdefresne1232aae2016-03-10 20:16:36133 "ninja_create_bundle_target_writer.cc",
134 "ninja_create_bundle_target_writer.h",
[email protected]c0822d7f2013-08-13 17:10:56135 "ninja_group_target_writer.cc",
136 "ninja_group_target_writer.h",
[email protected]ceb18412013-07-31 19:17:58137 "ninja_target_writer.cc",
138 "ninja_target_writer.h",
139 "ninja_toolchain_writer.cc",
140 "ninja_toolchain_writer.h",
scottmg7c7296f42015-02-28 02:23:09141 "ninja_utils.cc",
142 "ninja_utils.h",
[email protected]ceb18412013-07-31 19:17:58143 "ninja_writer.cc",
144 "ninja_writer.h",
145 "operators.cc",
146 "operators.h",
[email protected]0dfcae72014-08-19 22:52:16147 "output_file.cc",
[email protected]ceb18412013-07-31 19:17:58148 "output_file.h",
brettwc0ff8862016-06-28 21:41:12149 "parse_node_value_adapter.cc",
150 "parse_node_value_adapter.h",
[email protected]ceb18412013-07-31 19:17:58151 "parse_tree.cc",
152 "parse_tree.h",
153 "parser.cc",
154 "parser.h",
155 "path_output.cc",
156 "path_output.h",
157 "pattern.cc",
158 "pattern.h",
sdefresne40451c52016-06-04 12:37:29159 "pool.cc",
160 "pool.h",
kolczykaf72603e2016-05-13 13:41:32161 "qt_creator_writer.cc",
162 "qt_creator_writer.h",
brettw0db91852015-05-14 23:40:20163 "runtime_deps.cc",
164 "runtime_deps.h",
[email protected]ceb18412013-07-31 19:17:58165 "scheduler.cc",
166 "scheduler.h",
167 "scope.cc",
168 "scope.h",
169 "scope_per_file_provider.cc",
170 "scope_per_file_provider.h",
171 "settings.cc",
172 "settings.h",
173 "setup.cc",
174 "setup.h",
175 "source_dir.cc",
176 "source_dir.h",
177 "source_file.cc",
178 "source_file.h",
[email protected]0dfcae72014-08-19 22:52:16179 "source_file_type.cc",
180 "source_file_type.h",
[email protected]ceb18412013-07-31 19:17:58181 "standard_out.cc",
182 "standard_out.h",
183 "string_utils.cc",
184 "string_utils.h",
[email protected]012db5942014-08-06 20:38:45185 "substitution_list.cc",
186 "substitution_list.h",
187 "substitution_pattern.cc",
188 "substitution_pattern.h",
189 "substitution_type.cc",
190 "substitution_type.h",
191 "substitution_writer.cc",
192 "substitution_writer.h",
brettw86a7f4bd2014-11-26 22:07:28193 "switches.cc",
194 "switches.h",
[email protected]ceb18412013-07-31 19:17:58195 "target.cc",
196 "target.h",
197 "target_generator.cc",
198 "target_generator.h",
[email protected]a4e862922014-03-27 21:16:22199 "template.cc",
200 "template.h",
[email protected]ceb18412013-07-31 19:17:58201 "token.cc",
202 "token.h",
203 "tokenizer.cc",
scottmg7c7296f42015-02-28 02:23:09204 "tokenizer.h",
[email protected]0dfcae72014-08-19 22:52:16205 "tool.cc",
206 "tool.h",
[email protected]ceb18412013-07-31 19:17:58207 "toolchain.cc",
208 "toolchain.h",
[email protected]7f8c9fc2013-09-23 18:08:28209 "trace.cc",
210 "trace.h",
[email protected]8fc56182014-08-06 21:44:33211 "unique_vector.h",
[email protected]ceb18412013-07-31 19:17:58212 "value.cc",
213 "value.h",
214 "value_extractors.cc",
215 "value_extractors.h",
[email protected]4441041b2013-08-06 21:11:06216 "variables.cc",
217 "variables.h",
[email protected]60c9d172014-04-01 21:45:11218 "visibility.cc",
219 "visibility.h",
tmoniuszko050f20692016-01-29 16:15:36220 "visual_studio_utils.cc",
221 "visual_studio_utils.h",
222 "visual_studio_writer.cc",
223 "visual_studio_writer.h",
sdefresne6ee04b52016-05-03 22:20:10224 "xcode_object.cc",
225 "xcode_object.h",
226 "xcode_writer.cc",
227 "xcode_writer.h",
tmoniuszko050f20692016-01-29 16:15:36228 "xml_element_writer.cc",
229 "xml_element_writer.h",
[email protected]ceb18412013-07-31 19:17:58230 ]
[email protected]9af0b832013-11-08 20:31:13231
[email protected]ceb18412013-07-31 19:17:58232 deps = [
233 "//base",
234 "//base/third_party/dynamic_annotations",
235 ]
236}
237
Brett Wilson48c29f22014-08-25 19:06:58238action("last_commit_position") {
239 script = "last_commit_position.py"
240
241 # This dependency forces a re-run when the code is synced.
scottmg34fb7e52014-12-03 23:27:24242 inputs = [
243 "//build/util/LASTCHANGE",
244 ]
Brett Wilson48c29f22014-08-25 19:06:58245
246 outfile = "$target_gen_dir/last_commit_position.h"
scottmg34fb7e52014-12-03 23:27:24247 outputs = [
248 outfile,
249 ]
Brett Wilson48c29f22014-08-25 19:06:58250
251 args = [
252 rebase_path("//", root_build_dir),
253 rebase_path(outfile, root_build_dir),
254 "TOOLS_GN_LAST_COMMIT_POSITION_H_",
255 ]
256}
257
brettwe134d6c2015-08-03 21:06:01258# Note for Windows debugging: GN is super-multithreaded and uses a lot of STL.
259# Iterator debugging on Windows does locking for every access, which ends up
260# slowing down debug runtime from 0:36 to 9:40. If you want to run debug builds
261# of GN over the large Chrome build, you will want to set the arg:
262# enable_iterator_debugging = false
[email protected]ceb18412013-07-31 19:17:58263executable("gn") {
264 sources = [
265 "gn_main.cc",
266 ]
[email protected]9af0b832013-11-08 20:31:13267
[email protected]ceb18412013-07-31 19:17:58268 deps = [
269 ":gn_lib",
Brett Wilson48c29f22014-08-25 19:06:58270 ":last_commit_position",
tfarinab8e602bf2014-12-21 03:11:53271 "//base",
brettwba7a73d2015-08-31 22:17:39272 "//build/config/sanitizers:deps",
brucedawsonf9f7d6292016-04-27 19:11:07273 "//build/win:default_exe_manifest",
[email protected]ceb18412013-07-31 19:17:58274 ]
275}
276
277test("gn_unittests") {
278 sources = [
[email protected]012db5942014-08-06 20:38:45279 "action_target_generator_unittest.cc",
dpranke6d8fdaa2016-08-30 03:37:40280 "analyzer_unittest.cc",
skyca5cccef2015-03-16 18:06:00281 "args_unittest.cc",
[email protected]26542b02013-11-08 23:25:04282 "builder_unittest.cc",
[email protected]126d8b52014-04-07 22:17:35283 "c_include_iterator_unittest.cc",
scottmg2dd93e8b2014-09-26 04:07:05284 "command_format_unittest.cc",
brettwbd144422015-09-16 22:31:33285 "config_unittest.cc",
[email protected]58d2a902014-04-15 22:15:36286 "config_values_extractors_unittest.cc",
[email protected]ceb18412013-07-31 19:17:58287 "escape_unittest.cc",
cjhopman55793012014-10-16 19:19:40288 "exec_process_unittest.cc",
[email protected]ceb18412013-07-31 19:17:58289 "filesystem_utils_unittest.cc",
[email protected]92cafe52014-05-13 19:42:25290 "function_foreach_unittest.cc",
brettwdc957e1a2015-08-03 21:54:36291 "function_forward_variables_from_unittest.cc",
[email protected]7380ca72014-05-13 16:56:20292 "function_get_label_info_unittest.cc",
[email protected]01bd79b2014-06-05 17:36:25293 "function_get_path_info_unittest.cc",
[email protected]e1bd79f2014-05-05 20:27:53294 "function_get_target_outputs_unittest.cc",
[email protected]209d521c2014-08-12 23:29:06295 "function_process_file_template_unittest.cc",
[email protected]ea3690c2013-09-23 17:59:22296 "function_rebase_path_unittest.cc",
brettwba1286d2016-08-11 04:33:18297 "function_template_unittest.cc",
brettw15e0e74f2016-07-26 18:00:24298 "function_toolchain_unittest.cc",
[email protected]fd546752014-05-30 16:24:33299 "function_write_file_unittest.cc",
[email protected]3ffa36a2014-07-24 21:01:50300 "functions_target_unittest.cc",
[email protected]a4e862922014-03-27 21:16:22301 "functions_unittest.cc",
[email protected]126d8b52014-04-07 22:17:35302 "header_checker_unittest.cc",
brettw54d767532015-04-16 17:40:49303 "inherited_libraries_unittest.cc",
[email protected]ceb18412013-07-31 19:17:58304 "input_conversion_unittest.cc",
brettw3741b722014-08-29 17:07:20305 "label_pattern_unittest.cc",
[email protected]ceb18412013-07-31 19:17:58306 "label_unittest.cc",
[email protected]26542b02013-11-08 23:25:04307 "loader_unittest.cc",
[email protected]2fbe1012014-03-20 17:59:15308 "ninja_action_target_writer_unittest.cc",
[email protected]7ff2f5d2013-10-08 21:30:34309 "ninja_binary_target_writer_unittest.cc",
agrieve83671be2016-03-31 19:33:34310 "ninja_build_writer_unittest.cc",
sdefresne4c75ba482016-06-30 21:59:03311 "ninja_bundle_data_target_writer_unittest.cc",
[email protected]b90c75a2013-09-18 22:02:50312 "ninja_copy_target_writer_unittest.cc",
sdefresne1232aae2016-03-10 20:16:36313 "ninja_create_bundle_target_writer_unittest.cc",
cjhopman1b668a2e92014-09-09 16:30:40314 "ninja_group_target_writer_unittest.cc",
[email protected]ef348fe2014-05-01 18:31:31315 "ninja_target_writer_unittest.cc",
[email protected]0dfcae72014-08-19 22:52:16316 "ninja_toolchain_writer_unittest.cc",
[email protected]44196882013-12-21 05:31:11317 "operators_unittest.cc",
[email protected]51d01722014-03-26 16:57:07318 "parse_tree_unittest.cc",
[email protected]ceb18412013-07-31 19:17:58319 "parser_unittest.cc",
320 "path_output_unittest.cc",
321 "pattern_unittest.cc",
brettw0db91852015-05-14 23:40:20322 "runtime_deps_unittest.cc",
[email protected]17f43bf2013-08-23 21:04:46323 "scope_per_file_provider_unittest.cc",
[email protected]a2d0b7a2013-12-16 23:59:09324 "scope_unittest.cc",
[email protected]ceb18412013-07-31 19:17:58325 "source_dir_unittest.cc",
brettw84402032015-06-30 19:39:15326 "source_file_unittest.cc",
[email protected]ceb18412013-07-31 19:17:58327 "string_utils_unittest.cc",
[email protected]012db5942014-08-06 20:38:45328 "substitution_pattern_unittest.cc",
329 "substitution_writer_unittest.cc",
[email protected]3c1274d2013-09-10 22:21:21330 "target_unittest.cc",
[email protected]1e3fbf7b2014-04-08 19:15:20331 "template_unittest.cc",
[email protected]43bf6a52013-09-17 16:54:24332 "test_with_scope.cc",
333 "test_with_scope.h",
[email protected]ceb18412013-07-31 19:17:58334 "tokenizer_unittest.cc",
[email protected]8fc56182014-08-06 21:44:33335 "unique_vector_unittest.cc",
[email protected]d5645f12014-05-03 04:32:19336 "value_unittest.cc",
[email protected]60c9d172014-04-01 21:45:11337 "visibility_unittest.cc",
tmoniuszko050f20692016-01-29 16:15:36338 "visual_studio_utils_unittest.cc",
339 "visual_studio_writer_unittest.cc",
340 "xml_element_writer_unittest.cc",
[email protected]ceb18412013-07-31 19:17:58341 ]
dpranke177c1e22015-07-22 23:07:43342
343 data = [
344 "format_test_data/",
345 ]
346
[email protected]ceb18412013-07-31 19:17:58347 deps = [
348 ":gn_lib",
tfarina55116bef2015-03-25 03:40:19349 "//base/test:run_all_unittests",
[email protected]cc7ec692014-04-08 17:20:38350 "//base/test:test_support",
[email protected]23e197d2013-12-31 12:14:01351 "//testing/gtest",
[email protected]ceb18412013-07-31 19:17:58352 ]
353}
thakise47a47632016-08-24 18:19:49354
355fuzzer_test("gn_parser_fuzzer") {
356 sources = [
357 "parser_fuzzer.cc",
358 ]
359 deps = [
360 ":gn_lib",
361 ]
362}