blob: b27ae70f0d586920d9ede9b271a82d2bd877dc77 [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")
6
[email protected]15393202014-03-27 21:08:357defines = [ "GN_BUILD" ]
[email protected]9af0b832013-11-08 20:31:138
[email protected]ceb18412013-07-31 19:17:589static_library("gn_lib") {
brettw3dab5fe2015-06-29 23:00:1510 configs += [ "//build/config:precompiled_headers" ]
11
[email protected]ceb18412013-07-31 19:17:5812 sources = [
[email protected]2fbe1012014-03-20 17:59:1513 "action_target_generator.cc",
14 "action_target_generator.h",
15 "action_values.cc",
16 "action_values.h",
[email protected]60749e1c2013-08-19 21:11:0517 "args.cc",
18 "args.h",
[email protected]c0822d7f2013-08-13 17:10:5619 "binary_target_generator.cc",
20 "binary_target_generator.h",
[email protected]ceb18412013-07-31 19:17:5821 "build_settings.cc",
22 "build_settings.h",
[email protected]26542b02013-11-08 23:25:0423 "builder.cc",
24 "builder.h",
25 "builder_record.cc",
26 "builder_record.h",
sdefresnedb6b992c2016-03-04 16:32:1927 "bundle_data_target_generator.cc",
28 "bundle_data_target_generator.h",
[email protected]126d8b52014-04-07 22:17:3529 "c_include_iterator.cc",
30 "c_include_iterator.h",
[email protected]60749e1c2013-08-19 21:11:0531 "command_args.cc",
[email protected]126d8b52014-04-07 22:17:3532 "command_check.cc",
tfarina7ad21662015-02-17 22:17:3333 "command_clean.cc",
[email protected]ceb18412013-07-31 19:17:5834 "command_desc.cc",
scottmg2dd93e8b2014-09-26 04:07:0535 "command_format.cc",
tfarina7ad21662015-02-17 22:17:3336 "command_gen.cc",
[email protected]ceb18412013-07-31 19:17:5837 "command_help.cc",
brettw3741b722014-08-29 17:07:2038 "command_ls.cc",
brettw14769fd2015-05-19 22:22:2839 "command_path.cc",
[email protected]60749e1c2013-08-19 21:11:0540 "command_refs.cc",
[email protected]93c19fd22013-08-06 19:34:4441 "commands.cc",
42 "commands.h",
[email protected]ceb18412013-07-31 19:17:5843 "config.cc",
44 "config.h",
[email protected]93c19fd22013-08-06 19:34:4445 "config_values.cc",
[email protected]ceb18412013-07-31 19:17:5846 "config_values.h",
47 "config_values_extractors.cc",
48 "config_values_extractors.h",
49 "config_values_generator.cc",
50 "config_values_generator.h",
[email protected]c0822d7f2013-08-13 17:10:5651 "copy_target_generator.cc",
52 "copy_target_generator.h",
brettwc2e821a32014-09-17 01:07:1453 "deps_iterator.cc",
54 "deps_iterator.h",
pkotwicz19ca979d2016-02-19 19:39:4555 "eclipse_writer.cc",
56 "eclipse_writer.h",
[email protected]ceb18412013-07-31 19:17:5857 "err.cc",
58 "err.h",
59 "escape.cc",
60 "escape.h",
cjhopman55793012014-10-16 19:19:4061 "exec_process.cc",
62 "exec_process.h",
[email protected]ceb18412013-07-31 19:17:5863 "filesystem_utils.cc",
64 "filesystem_utils.h",
[email protected]ceb18412013-07-31 19:17:5865 "function_exec_script.cc",
[email protected]92cafe52014-05-13 19:42:2566 "function_foreach.cc",
brettwdc957e1a2015-08-03 21:54:3667 "function_forward_variables_from.cc",
[email protected]7380ca72014-05-13 16:56:2068 "function_get_label_info.cc",
[email protected]01bd79b2014-06-05 17:36:2569 "function_get_path_info.cc",
[email protected]e1bd79f2014-05-05 20:27:5370 "function_get_target_outputs.cc",
[email protected]ceb18412013-07-31 19:17:5871 "function_process_file_template.cc",
72 "function_read_file.cc",
[email protected]ea3690c2013-09-23 17:59:2273 "function_rebase_path.cc",
[email protected]ceb18412013-07-31 19:17:5874 "function_set_default_toolchain.cc",
[email protected]6b4ee782013-08-20 17:13:2475 "function_set_defaults.cc",
[email protected]ceb18412013-07-31 19:17:5876 "function_template.cc",
77 "function_toolchain.cc",
78 "function_write_file.cc",
scottmg7c7296f42015-02-28 02:23:0979 "functions.cc",
80 "functions.h",
81 "functions_target.cc",
[email protected]c0822d7f2013-08-13 17:10:5682 "group_target_generator.cc",
83 "group_target_generator.h",
[email protected]126d8b52014-04-07 22:17:3584 "header_checker.cc",
85 "header_checker.h",
[email protected]ceb18412013-07-31 19:17:5886 "import_manager.cc",
87 "import_manager.h",
brettw54d767532015-04-16 17:40:4988 "inherited_libraries.cc",
89 "inherited_libraries.h",
[email protected]ceb18412013-07-31 19:17:5890 "input_conversion.cc",
91 "input_conversion.h",
92 "input_file.cc",
93 "input_file.h",
94 "input_file_manager.cc",
95 "input_file_manager.h",
96 "item.cc",
97 "item.h",
[email protected]ceb18412013-07-31 19:17:5898 "label.cc",
99 "label.h",
brettw3741b722014-08-29 17:07:20100 "label_pattern.cc",
101 "label_pattern.h",
[email protected]68d1dd32013-11-01 21:59:51102 "label_ptr.h",
agrievef865ab8f2015-12-22 03:04:02103 "lib_file.cc",
104 "lib_file.h",
[email protected]26542b02013-11-08 23:25:04105 "loader.cc",
106 "loader.h",
[email protected]b0d3ad5d2013-09-16 23:31:36107 "location.cc",
[email protected]ceb18412013-07-31 19:17:58108 "location.h",
[email protected]2fbe1012014-03-20 17:59:15109 "ninja_action_target_writer.cc",
110 "ninja_action_target_writer.h",
[email protected]c0822d7f2013-08-13 17:10:56111 "ninja_binary_target_writer.cc",
112 "ninja_binary_target_writer.h",
[email protected]ceb18412013-07-31 19:17:58113 "ninja_build_writer.cc",
114 "ninja_build_writer.h",
sdefresnedb6b992c2016-03-04 16:32:19115 "ninja_bundle_data_target_writer.cc",
116 "ninja_bundle_data_target_writer.h",
[email protected]c0822d7f2013-08-13 17:10:56117 "ninja_copy_target_writer.cc",
118 "ninja_copy_target_writer.h",
119 "ninja_group_target_writer.cc",
120 "ninja_group_target_writer.h",
[email protected]ceb18412013-07-31 19:17:58121 "ninja_target_writer.cc",
122 "ninja_target_writer.h",
123 "ninja_toolchain_writer.cc",
124 "ninja_toolchain_writer.h",
scottmg7c7296f42015-02-28 02:23:09125 "ninja_utils.cc",
126 "ninja_utils.h",
[email protected]ceb18412013-07-31 19:17:58127 "ninja_writer.cc",
128 "ninja_writer.h",
129 "operators.cc",
130 "operators.h",
[email protected]0dfcae72014-08-19 22:52:16131 "output_file.cc",
[email protected]ceb18412013-07-31 19:17:58132 "output_file.h",
133 "parse_tree.cc",
134 "parse_tree.h",
135 "parser.cc",
136 "parser.h",
137 "path_output.cc",
138 "path_output.h",
139 "pattern.cc",
140 "pattern.h",
brettw0db91852015-05-14 23:40:20141 "runtime_deps.cc",
142 "runtime_deps.h",
[email protected]ceb18412013-07-31 19:17:58143 "scheduler.cc",
144 "scheduler.h",
145 "scope.cc",
146 "scope.h",
147 "scope_per_file_provider.cc",
148 "scope_per_file_provider.h",
149 "settings.cc",
150 "settings.h",
151 "setup.cc",
152 "setup.h",
153 "source_dir.cc",
154 "source_dir.h",
155 "source_file.cc",
156 "source_file.h",
[email protected]0dfcae72014-08-19 22:52:16157 "source_file_type.cc",
158 "source_file_type.h",
[email protected]ceb18412013-07-31 19:17:58159 "standard_out.cc",
160 "standard_out.h",
161 "string_utils.cc",
162 "string_utils.h",
[email protected]012db5942014-08-06 20:38:45163 "substitution_list.cc",
164 "substitution_list.h",
165 "substitution_pattern.cc",
166 "substitution_pattern.h",
167 "substitution_type.cc",
168 "substitution_type.h",
169 "substitution_writer.cc",
170 "substitution_writer.h",
brettw86a7f4bd2014-11-26 22:07:28171 "switches.cc",
172 "switches.h",
[email protected]ceb18412013-07-31 19:17:58173 "target.cc",
174 "target.h",
175 "target_generator.cc",
176 "target_generator.h",
[email protected]a4e862922014-03-27 21:16:22177 "template.cc",
178 "template.h",
[email protected]ceb18412013-07-31 19:17:58179 "token.cc",
180 "token.h",
181 "tokenizer.cc",
scottmg7c7296f42015-02-28 02:23:09182 "tokenizer.h",
[email protected]0dfcae72014-08-19 22:52:16183 "tool.cc",
184 "tool.h",
[email protected]ceb18412013-07-31 19:17:58185 "toolchain.cc",
186 "toolchain.h",
[email protected]7f8c9fc2013-09-23 18:08:28187 "trace.cc",
188 "trace.h",
[email protected]8fc56182014-08-06 21:44:33189 "unique_vector.h",
[email protected]ceb18412013-07-31 19:17:58190 "value.cc",
191 "value.h",
192 "value_extractors.cc",
193 "value_extractors.h",
[email protected]4441041b2013-08-06 21:11:06194 "variables.cc",
195 "variables.h",
[email protected]60c9d172014-04-01 21:45:11196 "visibility.cc",
197 "visibility.h",
tmoniuszko050f20692016-01-29 16:15:36198 "visual_studio_utils.cc",
199 "visual_studio_utils.h",
200 "visual_studio_writer.cc",
201 "visual_studio_writer.h",
202 "xml_element_writer.cc",
203 "xml_element_writer.h",
[email protected]ceb18412013-07-31 19:17:58204 ]
[email protected]9af0b832013-11-08 20:31:13205
[email protected]ceb18412013-07-31 19:17:58206 deps = [
207 "//base",
208 "//base/third_party/dynamic_annotations",
209 ]
210}
211
Brett Wilson48c29f22014-08-25 19:06:58212action("last_commit_position") {
213 script = "last_commit_position.py"
214
215 # This dependency forces a re-run when the code is synced.
scottmg34fb7e52014-12-03 23:27:24216 inputs = [
217 "//build/util/LASTCHANGE",
218 ]
Brett Wilson48c29f22014-08-25 19:06:58219
220 outfile = "$target_gen_dir/last_commit_position.h"
scottmg34fb7e52014-12-03 23:27:24221 outputs = [
222 outfile,
223 ]
Brett Wilson48c29f22014-08-25 19:06:58224
225 args = [
226 rebase_path("//", root_build_dir),
227 rebase_path(outfile, root_build_dir),
228 "TOOLS_GN_LAST_COMMIT_POSITION_H_",
229 ]
230}
231
brettwe134d6c2015-08-03 21:06:01232# Note for Windows debugging: GN is super-multithreaded and uses a lot of STL.
233# Iterator debugging on Windows does locking for every access, which ends up
234# slowing down debug runtime from 0:36 to 9:40. If you want to run debug builds
235# of GN over the large Chrome build, you will want to set the arg:
236# enable_iterator_debugging = false
[email protected]ceb18412013-07-31 19:17:58237executable("gn") {
238 sources = [
239 "gn_main.cc",
240 ]
[email protected]9af0b832013-11-08 20:31:13241
[email protected]ceb18412013-07-31 19:17:58242 deps = [
243 ":gn_lib",
Brett Wilson48c29f22014-08-25 19:06:58244 ":last_commit_position",
tfarinab8e602bf2014-12-21 03:11:53245 "//base",
brettwba7a73d2015-08-31 22:17:39246 "//build/config/sanitizers:deps",
[email protected]ceb18412013-07-31 19:17:58247 ]
248}
249
[email protected]ceb18412013-07-31 19:17:58250test("gn_unittests") {
251 sources = [
[email protected]012db5942014-08-06 20:38:45252 "action_target_generator_unittest.cc",
skyca5cccef2015-03-16 18:06:00253 "args_unittest.cc",
[email protected]26542b02013-11-08 23:25:04254 "builder_unittest.cc",
[email protected]126d8b52014-04-07 22:17:35255 "c_include_iterator_unittest.cc",
scottmg2dd93e8b2014-09-26 04:07:05256 "command_format_unittest.cc",
brettwbd144422015-09-16 22:31:33257 "config_unittest.cc",
[email protected]58d2a902014-04-15 22:15:36258 "config_values_extractors_unittest.cc",
[email protected]ceb18412013-07-31 19:17:58259 "escape_unittest.cc",
cjhopman55793012014-10-16 19:19:40260 "exec_process_unittest.cc",
[email protected]ceb18412013-07-31 19:17:58261 "filesystem_utils_unittest.cc",
[email protected]92cafe52014-05-13 19:42:25262 "function_foreach_unittest.cc",
brettwdc957e1a2015-08-03 21:54:36263 "function_forward_variables_from_unittest.cc",
[email protected]7380ca72014-05-13 16:56:20264 "function_get_label_info_unittest.cc",
[email protected]01bd79b2014-06-05 17:36:25265 "function_get_path_info_unittest.cc",
[email protected]e1bd79f2014-05-05 20:27:53266 "function_get_target_outputs_unittest.cc",
[email protected]209d521c2014-08-12 23:29:06267 "function_process_file_template_unittest.cc",
[email protected]ea3690c2013-09-23 17:59:22268 "function_rebase_path_unittest.cc",
[email protected]fd546752014-05-30 16:24:33269 "function_write_file_unittest.cc",
[email protected]3ffa36a2014-07-24 21:01:50270 "functions_target_unittest.cc",
[email protected]a4e862922014-03-27 21:16:22271 "functions_unittest.cc",
[email protected]126d8b52014-04-07 22:17:35272 "header_checker_unittest.cc",
brettw54d767532015-04-16 17:40:49273 "inherited_libraries_unittest.cc",
[email protected]ceb18412013-07-31 19:17:58274 "input_conversion_unittest.cc",
brettw3741b722014-08-29 17:07:20275 "label_pattern_unittest.cc",
[email protected]ceb18412013-07-31 19:17:58276 "label_unittest.cc",
[email protected]26542b02013-11-08 23:25:04277 "loader_unittest.cc",
[email protected]2fbe1012014-03-20 17:59:15278 "ninja_action_target_writer_unittest.cc",
[email protected]7ff2f5d2013-10-08 21:30:34279 "ninja_binary_target_writer_unittest.cc",
[email protected]b90c75a2013-09-18 22:02:50280 "ninja_copy_target_writer_unittest.cc",
cjhopman1b668a2e92014-09-09 16:30:40281 "ninja_group_target_writer_unittest.cc",
[email protected]ef348fe2014-05-01 18:31:31282 "ninja_target_writer_unittest.cc",
[email protected]0dfcae72014-08-19 22:52:16283 "ninja_toolchain_writer_unittest.cc",
[email protected]44196882013-12-21 05:31:11284 "operators_unittest.cc",
[email protected]51d01722014-03-26 16:57:07285 "parse_tree_unittest.cc",
[email protected]ceb18412013-07-31 19:17:58286 "parser_unittest.cc",
287 "path_output_unittest.cc",
288 "pattern_unittest.cc",
brettw0db91852015-05-14 23:40:20289 "runtime_deps_unittest.cc",
[email protected]17f43bf2013-08-23 21:04:46290 "scope_per_file_provider_unittest.cc",
[email protected]a2d0b7a2013-12-16 23:59:09291 "scope_unittest.cc",
[email protected]ceb18412013-07-31 19:17:58292 "source_dir_unittest.cc",
brettw84402032015-06-30 19:39:15293 "source_file_unittest.cc",
[email protected]ceb18412013-07-31 19:17:58294 "string_utils_unittest.cc",
[email protected]012db5942014-08-06 20:38:45295 "substitution_pattern_unittest.cc",
296 "substitution_writer_unittest.cc",
[email protected]3c1274d2013-09-10 22:21:21297 "target_unittest.cc",
[email protected]1e3fbf7b2014-04-08 19:15:20298 "template_unittest.cc",
[email protected]43bf6a52013-09-17 16:54:24299 "test_with_scope.cc",
300 "test_with_scope.h",
[email protected]ceb18412013-07-31 19:17:58301 "tokenizer_unittest.cc",
[email protected]8fc56182014-08-06 21:44:33302 "unique_vector_unittest.cc",
[email protected]d5645f12014-05-03 04:32:19303 "value_unittest.cc",
[email protected]60c9d172014-04-01 21:45:11304 "visibility_unittest.cc",
tmoniuszko050f20692016-01-29 16:15:36305 "visual_studio_utils_unittest.cc",
306 "visual_studio_writer_unittest.cc",
307 "xml_element_writer_unittest.cc",
[email protected]ceb18412013-07-31 19:17:58308 ]
dpranke177c1e22015-07-22 23:07:43309
310 data = [
311 "format_test_data/",
312 ]
313
[email protected]ceb18412013-07-31 19:17:58314 deps = [
315 ":gn_lib",
tfarina55116bef2015-03-25 03:40:19316 "//base/test:run_all_unittests",
[email protected]cc7ec692014-04-08 17:20:38317 "//base/test:test_support",
[email protected]23e197d2013-12-31 12:14:01318 "//testing/gtest",
[email protected]ceb18412013-07-31 19:17:58319 ]
320}