blob: bb36b1ffe2f58f2605ce1781f02899e5a35f7017 [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",
sdefresne1232aae2016-03-10 20:16:3627 "bundle_data.cc",
28 "bundle_data.h",
sdefresnedb6b992c2016-03-04 16:32:1929 "bundle_data_target_generator.cc",
30 "bundle_data_target_generator.h",
sdefresne1232aae2016-03-10 20:16:3631 "bundle_file_rule.cc",
32 "bundle_file_rule.h",
[email protected]126d8b52014-04-07 22:17:3533 "c_include_iterator.cc",
34 "c_include_iterator.h",
[email protected]60749e1c2013-08-19 21:11:0535 "command_args.cc",
[email protected]126d8b52014-04-07 22:17:3536 "command_check.cc",
tfarina7ad21662015-02-17 22:17:3337 "command_clean.cc",
[email protected]ceb18412013-07-31 19:17:5838 "command_desc.cc",
scottmg2dd93e8b2014-09-26 04:07:0539 "command_format.cc",
tfarina7ad21662015-02-17 22:17:3340 "command_gen.cc",
[email protected]ceb18412013-07-31 19:17:5841 "command_help.cc",
brettw3741b722014-08-29 17:07:2042 "command_ls.cc",
brettw14769fd2015-05-19 22:22:2843 "command_path.cc",
[email protected]60749e1c2013-08-19 21:11:0544 "command_refs.cc",
[email protected]93c19fd22013-08-06 19:34:4445 "commands.cc",
46 "commands.h",
[email protected]ceb18412013-07-31 19:17:5847 "config.cc",
48 "config.h",
[email protected]93c19fd22013-08-06 19:34:4449 "config_values.cc",
[email protected]ceb18412013-07-31 19:17:5850 "config_values.h",
51 "config_values_extractors.cc",
52 "config_values_extractors.h",
53 "config_values_generator.cc",
54 "config_values_generator.h",
[email protected]c0822d7f2013-08-13 17:10:5655 "copy_target_generator.cc",
56 "copy_target_generator.h",
sdefresne1232aae2016-03-10 20:16:3657 "create_bundle_target_generator.cc",
58 "create_bundle_target_generator.h",
brettwc2e821a32014-09-17 01:07:1459 "deps_iterator.cc",
60 "deps_iterator.h",
pkotwicz19ca979d2016-02-19 19:39:4561 "eclipse_writer.cc",
62 "eclipse_writer.h",
[email protected]ceb18412013-07-31 19:17:5863 "err.cc",
64 "err.h",
65 "escape.cc",
66 "escape.h",
cjhopman55793012014-10-16 19:19:4067 "exec_process.cc",
68 "exec_process.h",
[email protected]ceb18412013-07-31 19:17:5869 "filesystem_utils.cc",
70 "filesystem_utils.h",
[email protected]ceb18412013-07-31 19:17:5871 "function_exec_script.cc",
[email protected]92cafe52014-05-13 19:42:2572 "function_foreach.cc",
brettwdc957e1a2015-08-03 21:54:3673 "function_forward_variables_from.cc",
[email protected]7380ca72014-05-13 16:56:2074 "function_get_label_info.cc",
[email protected]01bd79b2014-06-05 17:36:2575 "function_get_path_info.cc",
[email protected]e1bd79f2014-05-05 20:27:5376 "function_get_target_outputs.cc",
[email protected]ceb18412013-07-31 19:17:5877 "function_process_file_template.cc",
78 "function_read_file.cc",
[email protected]ea3690c2013-09-23 17:59:2279 "function_rebase_path.cc",
[email protected]ceb18412013-07-31 19:17:5880 "function_set_default_toolchain.cc",
[email protected]6b4ee782013-08-20 17:13:2481 "function_set_defaults.cc",
[email protected]ceb18412013-07-31 19:17:5882 "function_template.cc",
83 "function_toolchain.cc",
84 "function_write_file.cc",
scottmg7c7296f42015-02-28 02:23:0985 "functions.cc",
86 "functions.h",
87 "functions_target.cc",
[email protected]c0822d7f2013-08-13 17:10:5688 "group_target_generator.cc",
89 "group_target_generator.h",
[email protected]126d8b52014-04-07 22:17:3590 "header_checker.cc",
91 "header_checker.h",
[email protected]ceb18412013-07-31 19:17:5892 "import_manager.cc",
93 "import_manager.h",
brettw54d767532015-04-16 17:40:4994 "inherited_libraries.cc",
95 "inherited_libraries.h",
[email protected]ceb18412013-07-31 19:17:5896 "input_conversion.cc",
97 "input_conversion.h",
98 "input_file.cc",
99 "input_file.h",
100 "input_file_manager.cc",
101 "input_file_manager.h",
102 "item.cc",
103 "item.h",
[email protected]ceb18412013-07-31 19:17:58104 "label.cc",
105 "label.h",
brettw3741b722014-08-29 17:07:20106 "label_pattern.cc",
107 "label_pattern.h",
[email protected]68d1dd32013-11-01 21:59:51108 "label_ptr.h",
agrievef865ab8f2015-12-22 03:04:02109 "lib_file.cc",
110 "lib_file.h",
[email protected]26542b02013-11-08 23:25:04111 "loader.cc",
112 "loader.h",
[email protected]b0d3ad5d2013-09-16 23:31:36113 "location.cc",
[email protected]ceb18412013-07-31 19:17:58114 "location.h",
[email protected]2fbe1012014-03-20 17:59:15115 "ninja_action_target_writer.cc",
116 "ninja_action_target_writer.h",
[email protected]c0822d7f2013-08-13 17:10:56117 "ninja_binary_target_writer.cc",
118 "ninja_binary_target_writer.h",
[email protected]ceb18412013-07-31 19:17:58119 "ninja_build_writer.cc",
120 "ninja_build_writer.h",
sdefresnedb6b992c2016-03-04 16:32:19121 "ninja_bundle_data_target_writer.cc",
122 "ninja_bundle_data_target_writer.h",
[email protected]c0822d7f2013-08-13 17:10:56123 "ninja_copy_target_writer.cc",
124 "ninja_copy_target_writer.h",
sdefresne1232aae2016-03-10 20:16:36125 "ninja_create_bundle_target_writer.cc",
126 "ninja_create_bundle_target_writer.h",
[email protected]c0822d7f2013-08-13 17:10:56127 "ninja_group_target_writer.cc",
128 "ninja_group_target_writer.h",
[email protected]ceb18412013-07-31 19:17:58129 "ninja_target_writer.cc",
130 "ninja_target_writer.h",
131 "ninja_toolchain_writer.cc",
132 "ninja_toolchain_writer.h",
scottmg7c7296f42015-02-28 02:23:09133 "ninja_utils.cc",
134 "ninja_utils.h",
[email protected]ceb18412013-07-31 19:17:58135 "ninja_writer.cc",
136 "ninja_writer.h",
137 "operators.cc",
138 "operators.h",
[email protected]0dfcae72014-08-19 22:52:16139 "output_file.cc",
[email protected]ceb18412013-07-31 19:17:58140 "output_file.h",
141 "parse_tree.cc",
142 "parse_tree.h",
143 "parser.cc",
144 "parser.h",
145 "path_output.cc",
146 "path_output.h",
147 "pattern.cc",
148 "pattern.h",
brettw0db91852015-05-14 23:40:20149 "runtime_deps.cc",
150 "runtime_deps.h",
[email protected]ceb18412013-07-31 19:17:58151 "scheduler.cc",
152 "scheduler.h",
153 "scope.cc",
154 "scope.h",
155 "scope_per_file_provider.cc",
156 "scope_per_file_provider.h",
157 "settings.cc",
158 "settings.h",
159 "setup.cc",
160 "setup.h",
161 "source_dir.cc",
162 "source_dir.h",
163 "source_file.cc",
164 "source_file.h",
[email protected]0dfcae72014-08-19 22:52:16165 "source_file_type.cc",
166 "source_file_type.h",
[email protected]ceb18412013-07-31 19:17:58167 "standard_out.cc",
168 "standard_out.h",
169 "string_utils.cc",
170 "string_utils.h",
[email protected]012db5942014-08-06 20:38:45171 "substitution_list.cc",
172 "substitution_list.h",
173 "substitution_pattern.cc",
174 "substitution_pattern.h",
175 "substitution_type.cc",
176 "substitution_type.h",
177 "substitution_writer.cc",
178 "substitution_writer.h",
brettw86a7f4bd2014-11-26 22:07:28179 "switches.cc",
180 "switches.h",
[email protected]ceb18412013-07-31 19:17:58181 "target.cc",
182 "target.h",
183 "target_generator.cc",
184 "target_generator.h",
[email protected]a4e862922014-03-27 21:16:22185 "template.cc",
186 "template.h",
[email protected]ceb18412013-07-31 19:17:58187 "token.cc",
188 "token.h",
189 "tokenizer.cc",
scottmg7c7296f42015-02-28 02:23:09190 "tokenizer.h",
[email protected]0dfcae72014-08-19 22:52:16191 "tool.cc",
192 "tool.h",
[email protected]ceb18412013-07-31 19:17:58193 "toolchain.cc",
194 "toolchain.h",
[email protected]7f8c9fc2013-09-23 18:08:28195 "trace.cc",
196 "trace.h",
[email protected]8fc56182014-08-06 21:44:33197 "unique_vector.h",
[email protected]ceb18412013-07-31 19:17:58198 "value.cc",
199 "value.h",
200 "value_extractors.cc",
201 "value_extractors.h",
[email protected]4441041b2013-08-06 21:11:06202 "variables.cc",
203 "variables.h",
[email protected]60c9d172014-04-01 21:45:11204 "visibility.cc",
205 "visibility.h",
tmoniuszko050f20692016-01-29 16:15:36206 "visual_studio_utils.cc",
207 "visual_studio_utils.h",
208 "visual_studio_writer.cc",
209 "visual_studio_writer.h",
210 "xml_element_writer.cc",
211 "xml_element_writer.h",
[email protected]ceb18412013-07-31 19:17:58212 ]
[email protected]9af0b832013-11-08 20:31:13213
[email protected]ceb18412013-07-31 19:17:58214 deps = [
215 "//base",
216 "//base/third_party/dynamic_annotations",
217 ]
218}
219
Brett Wilson48c29f22014-08-25 19:06:58220action("last_commit_position") {
221 script = "last_commit_position.py"
222
223 # This dependency forces a re-run when the code is synced.
scottmg34fb7e52014-12-03 23:27:24224 inputs = [
225 "//build/util/LASTCHANGE",
226 ]
Brett Wilson48c29f22014-08-25 19:06:58227
228 outfile = "$target_gen_dir/last_commit_position.h"
scottmg34fb7e52014-12-03 23:27:24229 outputs = [
230 outfile,
231 ]
Brett Wilson48c29f22014-08-25 19:06:58232
233 args = [
234 rebase_path("//", root_build_dir),
235 rebase_path(outfile, root_build_dir),
236 "TOOLS_GN_LAST_COMMIT_POSITION_H_",
237 ]
238}
239
brettwe134d6c2015-08-03 21:06:01240# Note for Windows debugging: GN is super-multithreaded and uses a lot of STL.
241# Iterator debugging on Windows does locking for every access, which ends up
242# slowing down debug runtime from 0:36 to 9:40. If you want to run debug builds
243# of GN over the large Chrome build, you will want to set the arg:
244# enable_iterator_debugging = false
[email protected]ceb18412013-07-31 19:17:58245executable("gn") {
246 sources = [
247 "gn_main.cc",
248 ]
[email protected]9af0b832013-11-08 20:31:13249
[email protected]ceb18412013-07-31 19:17:58250 deps = [
251 ":gn_lib",
Brett Wilson48c29f22014-08-25 19:06:58252 ":last_commit_position",
tfarinab8e602bf2014-12-21 03:11:53253 "//base",
brettwba7a73d2015-08-31 22:17:39254 "//build/config/sanitizers:deps",
[email protected]ceb18412013-07-31 19:17:58255 ]
256}
257
[email protected]ceb18412013-07-31 19:17:58258test("gn_unittests") {
259 sources = [
[email protected]012db5942014-08-06 20:38:45260 "action_target_generator_unittest.cc",
skyca5cccef2015-03-16 18:06:00261 "args_unittest.cc",
[email protected]26542b02013-11-08 23:25:04262 "builder_unittest.cc",
[email protected]126d8b52014-04-07 22:17:35263 "c_include_iterator_unittest.cc",
scottmg2dd93e8b2014-09-26 04:07:05264 "command_format_unittest.cc",
brettwbd144422015-09-16 22:31:33265 "config_unittest.cc",
[email protected]58d2a902014-04-15 22:15:36266 "config_values_extractors_unittest.cc",
[email protected]ceb18412013-07-31 19:17:58267 "escape_unittest.cc",
cjhopman55793012014-10-16 19:19:40268 "exec_process_unittest.cc",
[email protected]ceb18412013-07-31 19:17:58269 "filesystem_utils_unittest.cc",
[email protected]92cafe52014-05-13 19:42:25270 "function_foreach_unittest.cc",
brettwdc957e1a2015-08-03 21:54:36271 "function_forward_variables_from_unittest.cc",
[email protected]7380ca72014-05-13 16:56:20272 "function_get_label_info_unittest.cc",
[email protected]01bd79b2014-06-05 17:36:25273 "function_get_path_info_unittest.cc",
[email protected]e1bd79f2014-05-05 20:27:53274 "function_get_target_outputs_unittest.cc",
[email protected]209d521c2014-08-12 23:29:06275 "function_process_file_template_unittest.cc",
[email protected]ea3690c2013-09-23 17:59:22276 "function_rebase_path_unittest.cc",
[email protected]fd546752014-05-30 16:24:33277 "function_write_file_unittest.cc",
[email protected]3ffa36a2014-07-24 21:01:50278 "functions_target_unittest.cc",
[email protected]a4e862922014-03-27 21:16:22279 "functions_unittest.cc",
[email protected]126d8b52014-04-07 22:17:35280 "header_checker_unittest.cc",
brettw54d767532015-04-16 17:40:49281 "inherited_libraries_unittest.cc",
[email protected]ceb18412013-07-31 19:17:58282 "input_conversion_unittest.cc",
brettw3741b722014-08-29 17:07:20283 "label_pattern_unittest.cc",
[email protected]ceb18412013-07-31 19:17:58284 "label_unittest.cc",
[email protected]26542b02013-11-08 23:25:04285 "loader_unittest.cc",
[email protected]2fbe1012014-03-20 17:59:15286 "ninja_action_target_writer_unittest.cc",
[email protected]7ff2f5d2013-10-08 21:30:34287 "ninja_binary_target_writer_unittest.cc",
agrieve83671be2016-03-31 19:33:34288 "ninja_build_writer_unittest.cc",
[email protected]b90c75a2013-09-18 22:02:50289 "ninja_copy_target_writer_unittest.cc",
sdefresne1232aae2016-03-10 20:16:36290 "ninja_create_bundle_target_writer_unittest.cc",
cjhopman1b668a2e92014-09-09 16:30:40291 "ninja_group_target_writer_unittest.cc",
[email protected]ef348fe2014-05-01 18:31:31292 "ninja_target_writer_unittest.cc",
[email protected]0dfcae72014-08-19 22:52:16293 "ninja_toolchain_writer_unittest.cc",
[email protected]44196882013-12-21 05:31:11294 "operators_unittest.cc",
[email protected]51d01722014-03-26 16:57:07295 "parse_tree_unittest.cc",
[email protected]ceb18412013-07-31 19:17:58296 "parser_unittest.cc",
297 "path_output_unittest.cc",
298 "pattern_unittest.cc",
brettw0db91852015-05-14 23:40:20299 "runtime_deps_unittest.cc",
[email protected]17f43bf2013-08-23 21:04:46300 "scope_per_file_provider_unittest.cc",
[email protected]a2d0b7a2013-12-16 23:59:09301 "scope_unittest.cc",
[email protected]ceb18412013-07-31 19:17:58302 "source_dir_unittest.cc",
brettw84402032015-06-30 19:39:15303 "source_file_unittest.cc",
[email protected]ceb18412013-07-31 19:17:58304 "string_utils_unittest.cc",
[email protected]012db5942014-08-06 20:38:45305 "substitution_pattern_unittest.cc",
306 "substitution_writer_unittest.cc",
[email protected]3c1274d2013-09-10 22:21:21307 "target_unittest.cc",
[email protected]1e3fbf7b2014-04-08 19:15:20308 "template_unittest.cc",
[email protected]43bf6a52013-09-17 16:54:24309 "test_with_scope.cc",
310 "test_with_scope.h",
[email protected]ceb18412013-07-31 19:17:58311 "tokenizer_unittest.cc",
[email protected]8fc56182014-08-06 21:44:33312 "unique_vector_unittest.cc",
[email protected]d5645f12014-05-03 04:32:19313 "value_unittest.cc",
[email protected]60c9d172014-04-01 21:45:11314 "visibility_unittest.cc",
tmoniuszko050f20692016-01-29 16:15:36315 "visual_studio_utils_unittest.cc",
316 "visual_studio_writer_unittest.cc",
317 "xml_element_writer_unittest.cc",
[email protected]ceb18412013-07-31 19:17:58318 ]
dpranke177c1e22015-07-22 23:07:43319
320 data = [
321 "format_test_data/",
322 ]
323
[email protected]ceb18412013-07-31 19:17:58324 deps = [
325 ":gn_lib",
tfarina55116bef2015-03-25 03:40:19326 "//base/test:run_all_unittests",
[email protected]cc7ec692014-04-08 17:20:38327 "//base/test:test_support",
[email protected]23e197d2013-12-31 12:14:01328 "//testing/gtest",
[email protected]ceb18412013-07-31 19:17:58329 ]
330}