blob: e0de60e1194ea0c0274cde6141cca861c9738e6a [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") {
10 sources = [
[email protected]2fbe1012014-03-20 17:59:1511 "action_target_generator.cc",
12 "action_target_generator.h",
13 "action_values.cc",
14 "action_values.h",
[email protected]60749e1c2013-08-19 21:11:0515 "args.cc",
16 "args.h",
[email protected]c0822d7f2013-08-13 17:10:5617 "binary_target_generator.cc",
18 "binary_target_generator.h",
[email protected]ceb18412013-07-31 19:17:5819 "build_settings.cc",
20 "build_settings.h",
[email protected]26542b02013-11-08 23:25:0421 "builder.cc",
22 "builder.h",
23 "builder_record.cc",
24 "builder_record.h",
[email protected]126d8b52014-04-07 22:17:3525 "c_include_iterator.cc",
26 "c_include_iterator.h",
[email protected]60749e1c2013-08-19 21:11:0527 "command_args.cc",
[email protected]126d8b52014-04-07 22:17:3528 "command_check.cc",
tfarina7ad21662015-02-17 22:17:3329 "command_clean.cc",
[email protected]ceb18412013-07-31 19:17:5830 "command_desc.cc",
scottmg2dd93e8b2014-09-26 04:07:0531 "command_format.cc",
tfarina7ad21662015-02-17 22:17:3332 "command_gen.cc",
[email protected]ceb18412013-07-31 19:17:5833 "command_help.cc",
brettw3741b722014-08-29 17:07:2034 "command_ls.cc",
[email protected]60749e1c2013-08-19 21:11:0535 "command_refs.cc",
[email protected]93c19fd22013-08-06 19:34:4436 "commands.cc",
37 "commands.h",
[email protected]ceb18412013-07-31 19:17:5838 "config.cc",
39 "config.h",
[email protected]93c19fd22013-08-06 19:34:4440 "config_values.cc",
[email protected]ceb18412013-07-31 19:17:5841 "config_values.h",
42 "config_values_extractors.cc",
43 "config_values_extractors.h",
44 "config_values_generator.cc",
45 "config_values_generator.h",
[email protected]c0822d7f2013-08-13 17:10:5646 "copy_target_generator.cc",
47 "copy_target_generator.h",
brettwc2e821a32014-09-17 01:07:1448 "deps_iterator.cc",
49 "deps_iterator.h",
[email protected]ceb18412013-07-31 19:17:5850 "err.cc",
51 "err.h",
52 "escape.cc",
53 "escape.h",
cjhopman55793012014-10-16 19:19:4054 "exec_process.cc",
55 "exec_process.h",
[email protected]ceb18412013-07-31 19:17:5856 "filesystem_utils.cc",
57 "filesystem_utils.h",
58 "functions.cc",
59 "functions.h",
60 "functions_target.cc",
61 "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",
[email protected]c0822d7f2013-08-13 17:10:5674 "group_target_generator.cc",
75 "group_target_generator.h",
[email protected]126d8b52014-04-07 22:17:3576 "header_checker.cc",
77 "header_checker.h",
[email protected]ceb18412013-07-31 19:17:5878 "import_manager.cc",
79 "import_manager.h",
80 "input_conversion.cc",
81 "input_conversion.h",
82 "input_file.cc",
83 "input_file.h",
84 "input_file_manager.cc",
85 "input_file_manager.h",
86 "item.cc",
87 "item.h",
[email protected]ceb18412013-07-31 19:17:5888 "label.cc",
89 "label.h",
brettw3741b722014-08-29 17:07:2090 "label_pattern.cc",
91 "label_pattern.h",
[email protected]68d1dd32013-11-01 21:59:5192 "label_ptr.h",
[email protected]26542b02013-11-08 23:25:0493 "loader.cc",
94 "loader.h",
[email protected]b0d3ad5d2013-09-16 23:31:3695 "location.cc",
[email protected]ceb18412013-07-31 19:17:5896 "location.h",
[email protected]2fbe1012014-03-20 17:59:1597 "ninja_action_target_writer.cc",
98 "ninja_action_target_writer.h",
[email protected]c0822d7f2013-08-13 17:10:5699 "ninja_binary_target_writer.cc",
100 "ninja_binary_target_writer.h",
[email protected]ceb18412013-07-31 19:17:58101 "ninja_build_writer.cc",
102 "ninja_build_writer.h",
[email protected]c0822d7f2013-08-13 17:10:56103 "ninja_copy_target_writer.cc",
104 "ninja_copy_target_writer.h",
105 "ninja_group_target_writer.cc",
106 "ninja_group_target_writer.h",
[email protected]0dfcae72014-08-19 22:52:16107 "ninja_utils.cc",
108 "ninja_utils.h",
[email protected]ceb18412013-07-31 19:17:58109 "ninja_target_writer.cc",
110 "ninja_target_writer.h",
111 "ninja_toolchain_writer.cc",
112 "ninja_toolchain_writer.h",
113 "ninja_writer.cc",
114 "ninja_writer.h",
115 "operators.cc",
116 "operators.h",
[email protected]0dfcae72014-08-19 22:52:16117 "output_file.cc",
[email protected]ceb18412013-07-31 19:17:58118 "output_file.h",
119 "parse_tree.cc",
120 "parse_tree.h",
121 "parser.cc",
122 "parser.h",
123 "path_output.cc",
124 "path_output.h",
125 "pattern.cc",
126 "pattern.h",
127 "scheduler.cc",
128 "scheduler.h",
129 "scope.cc",
130 "scope.h",
131 "scope_per_file_provider.cc",
132 "scope_per_file_provider.h",
133 "settings.cc",
134 "settings.h",
135 "setup.cc",
136 "setup.h",
137 "source_dir.cc",
138 "source_dir.h",
139 "source_file.cc",
140 "source_file.h",
[email protected]0dfcae72014-08-19 22:52:16141 "source_file_type.cc",
142 "source_file_type.h",
[email protected]ceb18412013-07-31 19:17:58143 "standard_out.cc",
144 "standard_out.h",
145 "string_utils.cc",
146 "string_utils.h",
[email protected]012db5942014-08-06 20:38:45147 "substitution_list.cc",
148 "substitution_list.h",
149 "substitution_pattern.cc",
150 "substitution_pattern.h",
151 "substitution_type.cc",
152 "substitution_type.h",
153 "substitution_writer.cc",
154 "substitution_writer.h",
brettw86a7f4bd2014-11-26 22:07:28155 "switches.cc",
156 "switches.h",
[email protected]ceb18412013-07-31 19:17:58157 "target.cc",
158 "target.h",
159 "target_generator.cc",
160 "target_generator.h",
[email protected]a4e862922014-03-27 21:16:22161 "template.cc",
162 "template.h",
[email protected]ceb18412013-07-31 19:17:58163 "token.cc",
164 "token.h",
165 "tokenizer.cc",
[email protected]0dfcae72014-08-19 22:52:16166 "tool.cc",
167 "tool.h",
[email protected]ceb18412013-07-31 19:17:58168 "tokenizer.h",
169 "toolchain.cc",
170 "toolchain.h",
[email protected]7f8c9fc2013-09-23 18:08:28171 "trace.cc",
172 "trace.h",
[email protected]8fc56182014-08-06 21:44:33173 "unique_vector.h",
[email protected]ceb18412013-07-31 19:17:58174 "value.cc",
175 "value.h",
176 "value_extractors.cc",
177 "value_extractors.h",
[email protected]4441041b2013-08-06 21:11:06178 "variables.cc",
179 "variables.h",
[email protected]60c9d172014-04-01 21:45:11180 "visibility.cc",
181 "visibility.h",
[email protected]ceb18412013-07-31 19:17:58182 ]
[email protected]9af0b832013-11-08 20:31:13183
[email protected]ceb18412013-07-31 19:17:58184 deps = [
185 "//base",
186 "//base/third_party/dynamic_annotations",
187 ]
188}
189
Brett Wilson48c29f22014-08-25 19:06:58190action("last_commit_position") {
191 script = "last_commit_position.py"
192
193 # This dependency forces a re-run when the code is synced.
scottmg34fb7e52014-12-03 23:27:24194 inputs = [
195 "//build/util/LASTCHANGE",
196 ]
Brett Wilson48c29f22014-08-25 19:06:58197
198 outfile = "$target_gen_dir/last_commit_position.h"
scottmg34fb7e52014-12-03 23:27:24199 outputs = [
200 outfile,
201 ]
Brett Wilson48c29f22014-08-25 19:06:58202
203 args = [
204 rebase_path("//", root_build_dir),
205 rebase_path(outfile, root_build_dir),
206 "TOOLS_GN_LAST_COMMIT_POSITION_H_",
207 ]
208}
209
[email protected]ceb18412013-07-31 19:17:58210executable("gn") {
211 sources = [
212 "gn_main.cc",
213 ]
[email protected]9af0b832013-11-08 20:31:13214
[email protected]ceb18412013-07-31 19:17:58215 deps = [
216 ":gn_lib",
Brett Wilson48c29f22014-08-25 19:06:58217 ":last_commit_position",
tfarinab8e602bf2014-12-21 03:11:53218 "//base",
[email protected]ceb18412013-07-31 19:17:58219 ]
220}
221
222test("gn_unittests") {
223 sources = [
[email protected]012db5942014-08-06 20:38:45224 "action_target_generator_unittest.cc",
[email protected]26542b02013-11-08 23:25:04225 "builder_unittest.cc",
[email protected]126d8b52014-04-07 22:17:35226 "c_include_iterator_unittest.cc",
scottmg2dd93e8b2014-09-26 04:07:05227 "command_format_unittest.cc",
[email protected]58d2a902014-04-15 22:15:36228 "config_values_extractors_unittest.cc",
[email protected]ceb18412013-07-31 19:17:58229 "escape_unittest.cc",
cjhopman55793012014-10-16 19:19:40230 "exec_process_unittest.cc",
[email protected]ceb18412013-07-31 19:17:58231 "filesystem_utils_unittest.cc",
[email protected]92cafe52014-05-13 19:42:25232 "function_foreach_unittest.cc",
[email protected]7380ca72014-05-13 16:56:20233 "function_get_label_info_unittest.cc",
[email protected]01bd79b2014-06-05 17:36:25234 "function_get_path_info_unittest.cc",
[email protected]e1bd79f2014-05-05 20:27:53235 "function_get_target_outputs_unittest.cc",
[email protected]209d521c2014-08-12 23:29:06236 "function_process_file_template_unittest.cc",
[email protected]ea3690c2013-09-23 17:59:22237 "function_rebase_path_unittest.cc",
[email protected]fd546752014-05-30 16:24:33238 "function_write_file_unittest.cc",
[email protected]3ffa36a2014-07-24 21:01:50239 "functions_target_unittest.cc",
[email protected]a4e862922014-03-27 21:16:22240 "functions_unittest.cc",
[email protected]126d8b52014-04-07 22:17:35241 "header_checker_unittest.cc",
[email protected]ceb18412013-07-31 19:17:58242 "input_conversion_unittest.cc",
brettw3741b722014-08-29 17:07:20243 "label_pattern_unittest.cc",
[email protected]ceb18412013-07-31 19:17:58244 "label_unittest.cc",
[email protected]26542b02013-11-08 23:25:04245 "loader_unittest.cc",
[email protected]2fbe1012014-03-20 17:59:15246 "ninja_action_target_writer_unittest.cc",
[email protected]7ff2f5d2013-10-08 21:30:34247 "ninja_binary_target_writer_unittest.cc",
[email protected]b90c75a2013-09-18 22:02:50248 "ninja_copy_target_writer_unittest.cc",
cjhopman1b668a2e92014-09-09 16:30:40249 "ninja_group_target_writer_unittest.cc",
[email protected]ef348fe2014-05-01 18:31:31250 "ninja_target_writer_unittest.cc",
[email protected]0dfcae72014-08-19 22:52:16251 "ninja_toolchain_writer_unittest.cc",
[email protected]44196882013-12-21 05:31:11252 "operators_unittest.cc",
[email protected]51d01722014-03-26 16:57:07253 "parse_tree_unittest.cc",
[email protected]ceb18412013-07-31 19:17:58254 "parser_unittest.cc",
255 "path_output_unittest.cc",
256 "pattern_unittest.cc",
[email protected]98756e22014-06-04 16:57:40257 "run_all_unittests.cc",
[email protected]17f43bf2013-08-23 21:04:46258 "scope_per_file_provider_unittest.cc",
[email protected]a2d0b7a2013-12-16 23:59:09259 "scope_unittest.cc",
[email protected]ceb18412013-07-31 19:17:58260 "source_dir_unittest.cc",
261 "string_utils_unittest.cc",
[email protected]012db5942014-08-06 20:38:45262 "substitution_pattern_unittest.cc",
263 "substitution_writer_unittest.cc",
[email protected]ceb18412013-07-31 19:17:58264 "target_generator_unittest.cc",
[email protected]3c1274d2013-09-10 22:21:21265 "target_unittest.cc",
[email protected]1e3fbf7b2014-04-08 19:15:20266 "template_unittest.cc",
[email protected]43bf6a52013-09-17 16:54:24267 "test_with_scope.cc",
268 "test_with_scope.h",
[email protected]ceb18412013-07-31 19:17:58269 "tokenizer_unittest.cc",
[email protected]8fc56182014-08-06 21:44:33270 "unique_vector_unittest.cc",
[email protected]d5645f12014-05-03 04:32:19271 "value_unittest.cc",
[email protected]60c9d172014-04-01 21:45:11272 "visibility_unittest.cc",
[email protected]ceb18412013-07-31 19:17:58273 ]
274 deps = [
275 ":gn_lib",
[email protected]cc7ec692014-04-08 17:20:38276 "//base/test:test_support",
[email protected]23e197d2013-12-31 12:14:01277 "//testing/gtest",
[email protected]ceb18412013-07-31 19:17:58278 ]
279}
280
281executable("generate_test_gn_data") {
scottmg34fb7e52014-12-03 23:27:24282 sources = [
283 "generate_test_gn_data.cc",
284 ]
285 deps = [
286 "//base",
287 ]
[email protected]ceb18412013-07-31 19:17:58288}