blob: 8f9f012cd18f0d263f503be689dcff62262317b4 [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",
[email protected]126d8b52014-04-07 22:17:3527 "c_include_iterator.cc",
28 "c_include_iterator.h",
[email protected]60749e1c2013-08-19 21:11:0529 "command_args.cc",
[email protected]126d8b52014-04-07 22:17:3530 "command_check.cc",
tfarina7ad21662015-02-17 22:17:3331 "command_clean.cc",
[email protected]ceb18412013-07-31 19:17:5832 "command_desc.cc",
scottmg2dd93e8b2014-09-26 04:07:0533 "command_format.cc",
tfarina7ad21662015-02-17 22:17:3334 "command_gen.cc",
[email protected]ceb18412013-07-31 19:17:5835 "command_help.cc",
brettw3741b722014-08-29 17:07:2036 "command_ls.cc",
brettw14769fd2015-05-19 22:22:2837 "command_path.cc",
[email protected]60749e1c2013-08-19 21:11:0538 "command_refs.cc",
[email protected]93c19fd22013-08-06 19:34:4439 "commands.cc",
40 "commands.h",
[email protected]ceb18412013-07-31 19:17:5841 "config.cc",
42 "config.h",
[email protected]93c19fd22013-08-06 19:34:4443 "config_values.cc",
[email protected]ceb18412013-07-31 19:17:5844 "config_values.h",
45 "config_values_extractors.cc",
46 "config_values_extractors.h",
47 "config_values_generator.cc",
48 "config_values_generator.h",
[email protected]c0822d7f2013-08-13 17:10:5649 "copy_target_generator.cc",
50 "copy_target_generator.h",
brettwc2e821a32014-09-17 01:07:1451 "deps_iterator.cc",
52 "deps_iterator.h",
[email protected]ceb18412013-07-31 19:17:5853 "err.cc",
54 "err.h",
55 "escape.cc",
56 "escape.h",
cjhopman55793012014-10-16 19:19:4057 "exec_process.cc",
58 "exec_process.h",
[email protected]ceb18412013-07-31 19:17:5859 "filesystem_utils.cc",
60 "filesystem_utils.h",
[email protected]ceb18412013-07-31 19:17:5861 "function_exec_script.cc",
[email protected]92cafe52014-05-13 19:42:2562 "function_foreach.cc",
[email protected]7380ca72014-05-13 16:56:2063 "function_get_label_info.cc",
[email protected]01bd79b2014-06-05 17:36:2564 "function_get_path_info.cc",
[email protected]e1bd79f2014-05-05 20:27:5365 "function_get_target_outputs.cc",
[email protected]ceb18412013-07-31 19:17:5866 "function_process_file_template.cc",
67 "function_read_file.cc",
[email protected]ea3690c2013-09-23 17:59:2268 "function_rebase_path.cc",
[email protected]ceb18412013-07-31 19:17:5869 "function_set_default_toolchain.cc",
[email protected]6b4ee782013-08-20 17:13:2470 "function_set_defaults.cc",
[email protected]ceb18412013-07-31 19:17:5871 "function_template.cc",
72 "function_toolchain.cc",
73 "function_write_file.cc",
scottmg7c7296f42015-02-28 02:23:0974 "functions.cc",
75 "functions.h",
76 "functions_target.cc",
[email protected]c0822d7f2013-08-13 17:10:5677 "group_target_generator.cc",
78 "group_target_generator.h",
[email protected]126d8b52014-04-07 22:17:3579 "header_checker.cc",
80 "header_checker.h",
[email protected]ceb18412013-07-31 19:17:5881 "import_manager.cc",
82 "import_manager.h",
brettw54d767532015-04-16 17:40:4983 "inherited_libraries.cc",
84 "inherited_libraries.h",
[email protected]ceb18412013-07-31 19:17:5885 "input_conversion.cc",
86 "input_conversion.h",
87 "input_file.cc",
88 "input_file.h",
89 "input_file_manager.cc",
90 "input_file_manager.h",
91 "item.cc",
92 "item.h",
[email protected]ceb18412013-07-31 19:17:5893 "label.cc",
94 "label.h",
brettw3741b722014-08-29 17:07:2095 "label_pattern.cc",
96 "label_pattern.h",
[email protected]68d1dd32013-11-01 21:59:5197 "label_ptr.h",
[email protected]26542b02013-11-08 23:25:0498 "loader.cc",
99 "loader.h",
[email protected]b0d3ad5d2013-09-16 23:31:36100 "location.cc",
[email protected]ceb18412013-07-31 19:17:58101 "location.h",
[email protected]2fbe1012014-03-20 17:59:15102 "ninja_action_target_writer.cc",
103 "ninja_action_target_writer.h",
[email protected]c0822d7f2013-08-13 17:10:56104 "ninja_binary_target_writer.cc",
105 "ninja_binary_target_writer.h",
[email protected]ceb18412013-07-31 19:17:58106 "ninja_build_writer.cc",
107 "ninja_build_writer.h",
[email protected]c0822d7f2013-08-13 17:10:56108 "ninja_copy_target_writer.cc",
109 "ninja_copy_target_writer.h",
110 "ninja_group_target_writer.cc",
111 "ninja_group_target_writer.h",
[email protected]ceb18412013-07-31 19:17:58112 "ninja_target_writer.cc",
113 "ninja_target_writer.h",
114 "ninja_toolchain_writer.cc",
115 "ninja_toolchain_writer.h",
scottmg7c7296f42015-02-28 02:23:09116 "ninja_utils.cc",
117 "ninja_utils.h",
[email protected]ceb18412013-07-31 19:17:58118 "ninja_writer.cc",
119 "ninja_writer.h",
120 "operators.cc",
121 "operators.h",
[email protected]0dfcae72014-08-19 22:52:16122 "output_file.cc",
[email protected]ceb18412013-07-31 19:17:58123 "output_file.h",
124 "parse_tree.cc",
125 "parse_tree.h",
126 "parser.cc",
127 "parser.h",
128 "path_output.cc",
129 "path_output.h",
130 "pattern.cc",
131 "pattern.h",
brettw0db91852015-05-14 23:40:20132 "runtime_deps.cc",
133 "runtime_deps.h",
[email protected]ceb18412013-07-31 19:17:58134 "scheduler.cc",
135 "scheduler.h",
136 "scope.cc",
137 "scope.h",
138 "scope_per_file_provider.cc",
139 "scope_per_file_provider.h",
140 "settings.cc",
141 "settings.h",
142 "setup.cc",
143 "setup.h",
144 "source_dir.cc",
145 "source_dir.h",
146 "source_file.cc",
147 "source_file.h",
[email protected]0dfcae72014-08-19 22:52:16148 "source_file_type.cc",
149 "source_file_type.h",
[email protected]ceb18412013-07-31 19:17:58150 "standard_out.cc",
151 "standard_out.h",
152 "string_utils.cc",
153 "string_utils.h",
[email protected]012db5942014-08-06 20:38:45154 "substitution_list.cc",
155 "substitution_list.h",
156 "substitution_pattern.cc",
157 "substitution_pattern.h",
158 "substitution_type.cc",
159 "substitution_type.h",
160 "substitution_writer.cc",
161 "substitution_writer.h",
brettw86a7f4bd2014-11-26 22:07:28162 "switches.cc",
163 "switches.h",
[email protected]ceb18412013-07-31 19:17:58164 "target.cc",
165 "target.h",
166 "target_generator.cc",
167 "target_generator.h",
[email protected]a4e862922014-03-27 21:16:22168 "template.cc",
169 "template.h",
[email protected]ceb18412013-07-31 19:17:58170 "token.cc",
171 "token.h",
172 "tokenizer.cc",
scottmg7c7296f42015-02-28 02:23:09173 "tokenizer.h",
[email protected]0dfcae72014-08-19 22:52:16174 "tool.cc",
175 "tool.h",
[email protected]ceb18412013-07-31 19:17:58176 "toolchain.cc",
177 "toolchain.h",
[email protected]7f8c9fc2013-09-23 18:08:28178 "trace.cc",
179 "trace.h",
[email protected]8fc56182014-08-06 21:44:33180 "unique_vector.h",
[email protected]ceb18412013-07-31 19:17:58181 "value.cc",
182 "value.h",
183 "value_extractors.cc",
184 "value_extractors.h",
[email protected]4441041b2013-08-06 21:11:06185 "variables.cc",
186 "variables.h",
[email protected]60c9d172014-04-01 21:45:11187 "visibility.cc",
188 "visibility.h",
[email protected]ceb18412013-07-31 19:17:58189 ]
[email protected]9af0b832013-11-08 20:31:13190
[email protected]ceb18412013-07-31 19:17:58191 deps = [
192 "//base",
193 "//base/third_party/dynamic_annotations",
194 ]
195}
196
Brett Wilson48c29f22014-08-25 19:06:58197action("last_commit_position") {
198 script = "last_commit_position.py"
199
200 # This dependency forces a re-run when the code is synced.
scottmg34fb7e52014-12-03 23:27:24201 inputs = [
202 "//build/util/LASTCHANGE",
203 ]
Brett Wilson48c29f22014-08-25 19:06:58204
205 outfile = "$target_gen_dir/last_commit_position.h"
scottmg34fb7e52014-12-03 23:27:24206 outputs = [
207 outfile,
208 ]
Brett Wilson48c29f22014-08-25 19:06:58209
210 args = [
211 rebase_path("//", root_build_dir),
212 rebase_path(outfile, root_build_dir),
213 "TOOLS_GN_LAST_COMMIT_POSITION_H_",
214 ]
215}
216
[email protected]ceb18412013-07-31 19:17:58217executable("gn") {
218 sources = [
219 "gn_main.cc",
220 ]
[email protected]9af0b832013-11-08 20:31:13221
[email protected]ceb18412013-07-31 19:17:58222 deps = [
223 ":gn_lib",
Brett Wilson48c29f22014-08-25 19:06:58224 ":last_commit_position",
tfarinab8e602bf2014-12-21 03:11:53225 "//base",
[email protected]ceb18412013-07-31 19:17:58226 ]
227}
228
229test("gn_unittests") {
230 sources = [
[email protected]012db5942014-08-06 20:38:45231 "action_target_generator_unittest.cc",
skyca5cccef2015-03-16 18:06:00232 "args_unittest.cc",
[email protected]26542b02013-11-08 23:25:04233 "builder_unittest.cc",
[email protected]126d8b52014-04-07 22:17:35234 "c_include_iterator_unittest.cc",
scottmg2dd93e8b2014-09-26 04:07:05235 "command_format_unittest.cc",
[email protected]58d2a902014-04-15 22:15:36236 "config_values_extractors_unittest.cc",
[email protected]ceb18412013-07-31 19:17:58237 "escape_unittest.cc",
cjhopman55793012014-10-16 19:19:40238 "exec_process_unittest.cc",
[email protected]ceb18412013-07-31 19:17:58239 "filesystem_utils_unittest.cc",
[email protected]92cafe52014-05-13 19:42:25240 "function_foreach_unittest.cc",
[email protected]7380ca72014-05-13 16:56:20241 "function_get_label_info_unittest.cc",
[email protected]01bd79b2014-06-05 17:36:25242 "function_get_path_info_unittest.cc",
[email protected]e1bd79f2014-05-05 20:27:53243 "function_get_target_outputs_unittest.cc",
[email protected]209d521c2014-08-12 23:29:06244 "function_process_file_template_unittest.cc",
[email protected]ea3690c2013-09-23 17:59:22245 "function_rebase_path_unittest.cc",
[email protected]fd546752014-05-30 16:24:33246 "function_write_file_unittest.cc",
[email protected]3ffa36a2014-07-24 21:01:50247 "functions_target_unittest.cc",
[email protected]a4e862922014-03-27 21:16:22248 "functions_unittest.cc",
[email protected]126d8b52014-04-07 22:17:35249 "header_checker_unittest.cc",
brettw54d767532015-04-16 17:40:49250 "inherited_libraries_unittest.cc",
[email protected]ceb18412013-07-31 19:17:58251 "input_conversion_unittest.cc",
brettw3741b722014-08-29 17:07:20252 "label_pattern_unittest.cc",
[email protected]ceb18412013-07-31 19:17:58253 "label_unittest.cc",
[email protected]26542b02013-11-08 23:25:04254 "loader_unittest.cc",
[email protected]2fbe1012014-03-20 17:59:15255 "ninja_action_target_writer_unittest.cc",
[email protected]7ff2f5d2013-10-08 21:30:34256 "ninja_binary_target_writer_unittest.cc",
[email protected]b90c75a2013-09-18 22:02:50257 "ninja_copy_target_writer_unittest.cc",
cjhopman1b668a2e92014-09-09 16:30:40258 "ninja_group_target_writer_unittest.cc",
[email protected]ef348fe2014-05-01 18:31:31259 "ninja_target_writer_unittest.cc",
[email protected]0dfcae72014-08-19 22:52:16260 "ninja_toolchain_writer_unittest.cc",
[email protected]44196882013-12-21 05:31:11261 "operators_unittest.cc",
[email protected]51d01722014-03-26 16:57:07262 "parse_tree_unittest.cc",
[email protected]ceb18412013-07-31 19:17:58263 "parser_unittest.cc",
264 "path_output_unittest.cc",
265 "pattern_unittest.cc",
brettw0db91852015-05-14 23:40:20266 "runtime_deps_unittest.cc",
[email protected]17f43bf2013-08-23 21:04:46267 "scope_per_file_provider_unittest.cc",
[email protected]a2d0b7a2013-12-16 23:59:09268 "scope_unittest.cc",
[email protected]ceb18412013-07-31 19:17:58269 "source_dir_unittest.cc",
270 "string_utils_unittest.cc",
[email protected]012db5942014-08-06 20:38:45271 "substitution_pattern_unittest.cc",
272 "substitution_writer_unittest.cc",
[email protected]ceb18412013-07-31 19:17:58273 "target_generator_unittest.cc",
[email protected]3c1274d2013-09-10 22:21:21274 "target_unittest.cc",
[email protected]1e3fbf7b2014-04-08 19:15:20275 "template_unittest.cc",
[email protected]43bf6a52013-09-17 16:54:24276 "test_with_scope.cc",
277 "test_with_scope.h",
[email protected]ceb18412013-07-31 19:17:58278 "tokenizer_unittest.cc",
[email protected]8fc56182014-08-06 21:44:33279 "unique_vector_unittest.cc",
[email protected]d5645f12014-05-03 04:32:19280 "value_unittest.cc",
[email protected]60c9d172014-04-01 21:45:11281 "visibility_unittest.cc",
[email protected]ceb18412013-07-31 19:17:58282 ]
283 deps = [
284 ":gn_lib",
tfarina55116bef2015-03-25 03:40:19285 "//base/test:run_all_unittests",
[email protected]cc7ec692014-04-08 17:20:38286 "//base/test:test_support",
[email protected]23e197d2013-12-31 12:14:01287 "//testing/gtest",
[email protected]ceb18412013-07-31 19:17:58288 ]
289}
290
291executable("generate_test_gn_data") {
scottmg34fb7e52014-12-03 23:27:24292 sources = [
293 "generate_test_gn_data.cc",
294 ]
295 deps = [
296 "//base",
297 ]
[email protected]ceb18412013-07-31 19:17:58298}