blob: a0801a131c3c3ff93bd88848caa947356892054e [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",
brettwc0ff8862016-06-28 21:41:12141 "parse_node_value_adapter.cc",
142 "parse_node_value_adapter.h",
[email protected]ceb18412013-07-31 19:17:58143 "parse_tree.cc",
144 "parse_tree.h",
145 "parser.cc",
146 "parser.h",
147 "path_output.cc",
148 "path_output.h",
149 "pattern.cc",
150 "pattern.h",
sdefresne40451c52016-06-04 12:37:29151 "pool.cc",
152 "pool.h",
kolczykaf72603e2016-05-13 13:41:32153 "qt_creator_writer.cc",
154 "qt_creator_writer.h",
brettw0db91852015-05-14 23:40:20155 "runtime_deps.cc",
156 "runtime_deps.h",
[email protected]ceb18412013-07-31 19:17:58157 "scheduler.cc",
158 "scheduler.h",
159 "scope.cc",
160 "scope.h",
161 "scope_per_file_provider.cc",
162 "scope_per_file_provider.h",
163 "settings.cc",
164 "settings.h",
165 "setup.cc",
166 "setup.h",
167 "source_dir.cc",
168 "source_dir.h",
169 "source_file.cc",
170 "source_file.h",
[email protected]0dfcae72014-08-19 22:52:16171 "source_file_type.cc",
172 "source_file_type.h",
[email protected]ceb18412013-07-31 19:17:58173 "standard_out.cc",
174 "standard_out.h",
175 "string_utils.cc",
176 "string_utils.h",
[email protected]012db5942014-08-06 20:38:45177 "substitution_list.cc",
178 "substitution_list.h",
179 "substitution_pattern.cc",
180 "substitution_pattern.h",
181 "substitution_type.cc",
182 "substitution_type.h",
183 "substitution_writer.cc",
184 "substitution_writer.h",
brettw86a7f4bd2014-11-26 22:07:28185 "switches.cc",
186 "switches.h",
[email protected]ceb18412013-07-31 19:17:58187 "target.cc",
188 "target.h",
189 "target_generator.cc",
190 "target_generator.h",
[email protected]a4e862922014-03-27 21:16:22191 "template.cc",
192 "template.h",
[email protected]ceb18412013-07-31 19:17:58193 "token.cc",
194 "token.h",
195 "tokenizer.cc",
scottmg7c7296f42015-02-28 02:23:09196 "tokenizer.h",
[email protected]0dfcae72014-08-19 22:52:16197 "tool.cc",
198 "tool.h",
[email protected]ceb18412013-07-31 19:17:58199 "toolchain.cc",
200 "toolchain.h",
[email protected]7f8c9fc2013-09-23 18:08:28201 "trace.cc",
202 "trace.h",
[email protected]8fc56182014-08-06 21:44:33203 "unique_vector.h",
[email protected]ceb18412013-07-31 19:17:58204 "value.cc",
205 "value.h",
206 "value_extractors.cc",
207 "value_extractors.h",
[email protected]4441041b2013-08-06 21:11:06208 "variables.cc",
209 "variables.h",
[email protected]60c9d172014-04-01 21:45:11210 "visibility.cc",
211 "visibility.h",
tmoniuszko050f20692016-01-29 16:15:36212 "visual_studio_utils.cc",
213 "visual_studio_utils.h",
214 "visual_studio_writer.cc",
215 "visual_studio_writer.h",
sdefresne6ee04b52016-05-03 22:20:10216 "xcode_object.cc",
217 "xcode_object.h",
218 "xcode_writer.cc",
219 "xcode_writer.h",
tmoniuszko050f20692016-01-29 16:15:36220 "xml_element_writer.cc",
221 "xml_element_writer.h",
[email protected]ceb18412013-07-31 19:17:58222 ]
[email protected]9af0b832013-11-08 20:31:13223
[email protected]ceb18412013-07-31 19:17:58224 deps = [
225 "//base",
226 "//base/third_party/dynamic_annotations",
227 ]
228}
229
Brett Wilson48c29f22014-08-25 19:06:58230action("last_commit_position") {
231 script = "last_commit_position.py"
232
233 # This dependency forces a re-run when the code is synced.
scottmg34fb7e52014-12-03 23:27:24234 inputs = [
235 "//build/util/LASTCHANGE",
236 ]
Brett Wilson48c29f22014-08-25 19:06:58237
238 outfile = "$target_gen_dir/last_commit_position.h"
scottmg34fb7e52014-12-03 23:27:24239 outputs = [
240 outfile,
241 ]
Brett Wilson48c29f22014-08-25 19:06:58242
243 args = [
244 rebase_path("//", root_build_dir),
245 rebase_path(outfile, root_build_dir),
246 "TOOLS_GN_LAST_COMMIT_POSITION_H_",
247 ]
248}
249
brettwe134d6c2015-08-03 21:06:01250# Note for Windows debugging: GN is super-multithreaded and uses a lot of STL.
251# Iterator debugging on Windows does locking for every access, which ends up
252# slowing down debug runtime from 0:36 to 9:40. If you want to run debug builds
253# of GN over the large Chrome build, you will want to set the arg:
254# enable_iterator_debugging = false
[email protected]ceb18412013-07-31 19:17:58255executable("gn") {
256 sources = [
257 "gn_main.cc",
258 ]
[email protected]9af0b832013-11-08 20:31:13259
[email protected]ceb18412013-07-31 19:17:58260 deps = [
261 ":gn_lib",
Brett Wilson48c29f22014-08-25 19:06:58262 ":last_commit_position",
tfarinab8e602bf2014-12-21 03:11:53263 "//base",
brettwba7a73d2015-08-31 22:17:39264 "//build/config/sanitizers:deps",
brucedawsonf9f7d6292016-04-27 19:11:07265 "//build/win:default_exe_manifest",
[email protected]ceb18412013-07-31 19:17:58266 ]
267}
268
[email protected]ceb18412013-07-31 19:17:58269test("gn_unittests") {
270 sources = [
[email protected]012db5942014-08-06 20:38:45271 "action_target_generator_unittest.cc",
skyca5cccef2015-03-16 18:06:00272 "args_unittest.cc",
[email protected]26542b02013-11-08 23:25:04273 "builder_unittest.cc",
[email protected]126d8b52014-04-07 22:17:35274 "c_include_iterator_unittest.cc",
scottmg2dd93e8b2014-09-26 04:07:05275 "command_format_unittest.cc",
brettwbd144422015-09-16 22:31:33276 "config_unittest.cc",
[email protected]58d2a902014-04-15 22:15:36277 "config_values_extractors_unittest.cc",
[email protected]ceb18412013-07-31 19:17:58278 "escape_unittest.cc",
cjhopman55793012014-10-16 19:19:40279 "exec_process_unittest.cc",
[email protected]ceb18412013-07-31 19:17:58280 "filesystem_utils_unittest.cc",
[email protected]92cafe52014-05-13 19:42:25281 "function_foreach_unittest.cc",
brettwdc957e1a2015-08-03 21:54:36282 "function_forward_variables_from_unittest.cc",
[email protected]7380ca72014-05-13 16:56:20283 "function_get_label_info_unittest.cc",
[email protected]01bd79b2014-06-05 17:36:25284 "function_get_path_info_unittest.cc",
[email protected]e1bd79f2014-05-05 20:27:53285 "function_get_target_outputs_unittest.cc",
[email protected]209d521c2014-08-12 23:29:06286 "function_process_file_template_unittest.cc",
[email protected]ea3690c2013-09-23 17:59:22287 "function_rebase_path_unittest.cc",
[email protected]fd546752014-05-30 16:24:33288 "function_write_file_unittest.cc",
[email protected]3ffa36a2014-07-24 21:01:50289 "functions_target_unittest.cc",
[email protected]a4e862922014-03-27 21:16:22290 "functions_unittest.cc",
[email protected]126d8b52014-04-07 22:17:35291 "header_checker_unittest.cc",
brettw54d767532015-04-16 17:40:49292 "inherited_libraries_unittest.cc",
[email protected]ceb18412013-07-31 19:17:58293 "input_conversion_unittest.cc",
brettw3741b722014-08-29 17:07:20294 "label_pattern_unittest.cc",
[email protected]ceb18412013-07-31 19:17:58295 "label_unittest.cc",
[email protected]26542b02013-11-08 23:25:04296 "loader_unittest.cc",
[email protected]2fbe1012014-03-20 17:59:15297 "ninja_action_target_writer_unittest.cc",
[email protected]7ff2f5d2013-10-08 21:30:34298 "ninja_binary_target_writer_unittest.cc",
agrieve83671be2016-03-31 19:33:34299 "ninja_build_writer_unittest.cc",
[email protected]b90c75a2013-09-18 22:02:50300 "ninja_copy_target_writer_unittest.cc",
sdefresne1232aae2016-03-10 20:16:36301 "ninja_create_bundle_target_writer_unittest.cc",
cjhopman1b668a2e92014-09-09 16:30:40302 "ninja_group_target_writer_unittest.cc",
[email protected]ef348fe2014-05-01 18:31:31303 "ninja_target_writer_unittest.cc",
[email protected]0dfcae72014-08-19 22:52:16304 "ninja_toolchain_writer_unittest.cc",
[email protected]44196882013-12-21 05:31:11305 "operators_unittest.cc",
[email protected]51d01722014-03-26 16:57:07306 "parse_tree_unittest.cc",
[email protected]ceb18412013-07-31 19:17:58307 "parser_unittest.cc",
308 "path_output_unittest.cc",
309 "pattern_unittest.cc",
brettw0db91852015-05-14 23:40:20310 "runtime_deps_unittest.cc",
[email protected]17f43bf2013-08-23 21:04:46311 "scope_per_file_provider_unittest.cc",
[email protected]a2d0b7a2013-12-16 23:59:09312 "scope_unittest.cc",
[email protected]ceb18412013-07-31 19:17:58313 "source_dir_unittest.cc",
brettw84402032015-06-30 19:39:15314 "source_file_unittest.cc",
[email protected]ceb18412013-07-31 19:17:58315 "string_utils_unittest.cc",
[email protected]012db5942014-08-06 20:38:45316 "substitution_pattern_unittest.cc",
317 "substitution_writer_unittest.cc",
[email protected]3c1274d2013-09-10 22:21:21318 "target_unittest.cc",
[email protected]1e3fbf7b2014-04-08 19:15:20319 "template_unittest.cc",
[email protected]43bf6a52013-09-17 16:54:24320 "test_with_scope.cc",
321 "test_with_scope.h",
[email protected]ceb18412013-07-31 19:17:58322 "tokenizer_unittest.cc",
[email protected]8fc56182014-08-06 21:44:33323 "unique_vector_unittest.cc",
[email protected]d5645f12014-05-03 04:32:19324 "value_unittest.cc",
[email protected]60c9d172014-04-01 21:45:11325 "visibility_unittest.cc",
tmoniuszko050f20692016-01-29 16:15:36326 "visual_studio_utils_unittest.cc",
327 "visual_studio_writer_unittest.cc",
328 "xml_element_writer_unittest.cc",
[email protected]ceb18412013-07-31 19:17:58329 ]
dpranke177c1e22015-07-22 23:07:43330
331 data = [
332 "format_test_data/",
333 ]
334
[email protected]ceb18412013-07-31 19:17:58335 deps = [
336 ":gn_lib",
tfarina55116bef2015-03-25 03:40:19337 "//base/test:run_all_unittests",
[email protected]cc7ec692014-04-08 17:20:38338 "//base/test:test_support",
[email protected]23e197d2013-12-31 12:14:01339 "//testing/gtest",
[email protected]ceb18412013-07-31 19:17:58340 ]
341}