blob: 2892fbbf6445d7af4753bd92bf0c75345f096c26 [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
5gyp_file = "gn.gyp"
[email protected]b2d5b0e2013-11-14 23:46:116external = true
[email protected]e3730f812013-10-16 16:46:147
[email protected]3b4f1de2013-11-12 04:07:008# Not defined when doing a GYP build, this lets the code key off of GN-specific
9# features (the last change target). This can be removed when the last change
10# target is supported by the GN->GYP converter (see is_gyp conditional for that
11# below).
12if (!is_gyp) {
13 defines = [ "GN_BUILD" ]
14}
[email protected]9af0b832013-11-08 20:31:1315
[email protected]ceb18412013-07-31 19:17:5816static_library("gn_lib") {
17 sources = [
[email protected]2fbe1012014-03-20 17:59:1518 "action_target_generator.cc",
19 "action_target_generator.h",
20 "action_values.cc",
21 "action_values.h",
[email protected]60749e1c2013-08-19 21:11:0522 "args.cc",
23 "args.h",
[email protected]c0822d7f2013-08-13 17:10:5624 "binary_target_generator.cc",
25 "binary_target_generator.h",
[email protected]ceb18412013-07-31 19:17:5826 "build_settings.cc",
27 "build_settings.h",
[email protected]26542b02013-11-08 23:25:0428 "builder.cc",
29 "builder.h",
30 "builder_record.cc",
31 "builder_record.h",
[email protected]60749e1c2013-08-19 21:11:0532 "command_args.cc",
[email protected]ceb18412013-07-31 19:17:5833 "command_desc.cc",
34 "command_gen.cc",
[email protected]0a79fe42013-08-29 21:06:2635 "command_gyp.cc",
[email protected]ceb18412013-07-31 19:17:5836 "command_help.cc",
[email protected]60749e1c2013-08-19 21:11:0537 "command_refs.cc",
[email protected]93c19fd22013-08-06 19:34:4438 "commands.cc",
39 "commands.h",
[email protected]ceb18412013-07-31 19:17:5840 "config.cc",
41 "config.h",
[email protected]93c19fd22013-08-06 19:34:4442 "config_values.cc",
[email protected]ceb18412013-07-31 19:17:5843 "config_values.h",
44 "config_values_extractors.cc",
45 "config_values_extractors.h",
46 "config_values_generator.cc",
47 "config_values_generator.h",
[email protected]c0822d7f2013-08-13 17:10:5648 "copy_target_generator.cc",
49 "copy_target_generator.h",
[email protected]ceb18412013-07-31 19:17:5850 "err.cc",
51 "err.h",
52 "escape.cc",
53 "escape.h",
54 "file_template.cc",
55 "file_template.h",
56 "filesystem_utils.cc",
57 "filesystem_utils.h",
58 "functions.cc",
59 "functions.h",
60 "functions_target.cc",
61 "function_exec_script.cc",
62 "function_process_file_template.cc",
63 "function_read_file.cc",
[email protected]ea3690c2013-09-23 17:59:2264 "function_rebase_path.cc",
[email protected]ceb18412013-07-31 19:17:5865 "function_set_default_toolchain.cc",
[email protected]6b4ee782013-08-20 17:13:2466 "function_set_defaults.cc",
[email protected]ceb18412013-07-31 19:17:5867 "function_template.cc",
68 "function_toolchain.cc",
69 "function_write_file.cc",
[email protected]c0822d7f2013-08-13 17:10:5670 "group_target_generator.cc",
71 "group_target_generator.h",
[email protected]e3730f812013-10-16 16:46:1472 "gyp_binary_target_writer.cc",
73 "gyp_binary_target_writer.h",
74 "gyp_helper.cc",
75 "gyp_helper.h",
[email protected]2fbe1012014-03-20 17:59:1576 "gyp_action_target_writer.cc",
77 "gyp_action_target_writer.h",
[email protected]e3730f812013-10-16 16:46:1478 "gyp_target_writer.cc",
79 "gyp_target_writer.h",
[email protected]ceb18412013-07-31 19:17:5880 "import_manager.cc",
81 "import_manager.h",
82 "input_conversion.cc",
83 "input_conversion.h",
84 "input_file.cc",
85 "input_file.h",
86 "input_file_manager.cc",
87 "input_file_manager.h",
88 "item.cc",
89 "item.h",
[email protected]ceb18412013-07-31 19:17:5890 "label.cc",
91 "label.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]ceb18412013-07-31 19:17:58107 "ninja_helper.cc",
108 "ninja_helper.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",
117 "output_file.h",
118 "parse_tree.cc",
119 "parse_tree.h",
120 "parser.cc",
121 "parser.h",
122 "path_output.cc",
123 "path_output.h",
124 "pattern.cc",
125 "pattern.h",
126 "scheduler.cc",
127 "scheduler.h",
128 "scope.cc",
129 "scope.h",
130 "scope_per_file_provider.cc",
131 "scope_per_file_provider.h",
[email protected]ceb18412013-07-31 19:17:58132 "settings.cc",
133 "settings.h",
134 "setup.cc",
135 "setup.h",
136 "source_dir.cc",
137 "source_dir.h",
138 "source_file.cc",
139 "source_file.h",
140 "standard_out.cc",
141 "standard_out.h",
142 "string_utils.cc",
143 "string_utils.h",
144 "target.cc",
145 "target.h",
146 "target_generator.cc",
147 "target_generator.h",
[email protected]ceb18412013-07-31 19:17:58148 "token.cc",
149 "token.h",
150 "tokenizer.cc",
151 "tokenizer.h",
152 "toolchain.cc",
153 "toolchain.h",
[email protected]7f8c9fc2013-09-23 18:08:28154 "trace.cc",
155 "trace.h",
[email protected]ceb18412013-07-31 19:17:58156 "value.cc",
157 "value.h",
158 "value_extractors.cc",
159 "value_extractors.h",
[email protected]4441041b2013-08-06 21:11:06160 "variables.cc",
161 "variables.h",
[email protected]ceb18412013-07-31 19:17:58162 ]
[email protected]9af0b832013-11-08 20:31:13163
[email protected]ceb18412013-07-31 19:17:58164 deps = [
165 "//base",
166 "//base/third_party/dynamic_annotations",
167 ]
168}
169
170executable("gn") {
171 sources = [
172 "gn_main.cc",
173 ]
[email protected]9af0b832013-11-08 20:31:13174
[email protected]ceb18412013-07-31 19:17:58175 deps = [
176 ":gn_lib",
177 ]
[email protected]3b4f1de2013-11-12 04:07:00178 if (!is_gyp) {
179 # Currently this only works in GYP (see GN_BUILD above).
[email protected]bfac2722014-01-17 20:19:45180 deps += [ "//build/util:last_change" ]
[email protected]3b4f1de2013-11-12 04:07:00181 }
[email protected]ceb18412013-07-31 19:17:58182}
183
184test("gn_unittests") {
185 sources = [
[email protected]26542b02013-11-08 23:25:04186 "builder_unittest.cc",
[email protected]ceb18412013-07-31 19:17:58187 "escape_unittest.cc",
[email protected]ceb18412013-07-31 19:17:58188 "filesystem_utils_unittest.cc",
[email protected]2fbe1012014-03-20 17:59:15189 "file_template_unittest.cc",
[email protected]ea3690c2013-09-23 17:59:22190 "function_rebase_path_unittest.cc",
[email protected]2fbe1012014-03-20 17:59:15191 "gyp_action_target_writer_unittest.cc",
[email protected]b9473ee2014-02-28 21:51:10192 "gyp_binary_target_writer_unittest.cc",
[email protected]ceb18412013-07-31 19:17:58193 "input_conversion_unittest.cc",
194 "label_unittest.cc",
[email protected]26542b02013-11-08 23:25:04195 "loader_unittest.cc",
[email protected]2fbe1012014-03-20 17:59:15196 "ninja_action_target_writer_unittest.cc",
[email protected]7ff2f5d2013-10-08 21:30:34197 "ninja_binary_target_writer_unittest.cc",
[email protected]b90c75a2013-09-18 22:02:50198 "ninja_copy_target_writer_unittest.cc",
[email protected]ceb18412013-07-31 19:17:58199 "ninja_helper_unittest.cc",
[email protected]44196882013-12-21 05:31:11200 "operators_unittest.cc",
[email protected]51d01722014-03-26 16:57:07201 "parse_tree_unittest.cc",
[email protected]ceb18412013-07-31 19:17:58202 "parser_unittest.cc",
203 "path_output_unittest.cc",
204 "pattern_unittest.cc",
[email protected]17f43bf2013-08-23 21:04:46205 "scope_per_file_provider_unittest.cc",
[email protected]a2d0b7a2013-12-16 23:59:09206 "scope_unittest.cc",
[email protected]ceb18412013-07-31 19:17:58207 "source_dir_unittest.cc",
208 "string_utils_unittest.cc",
209 "target_generator_unittest.cc",
[email protected]3c1274d2013-09-10 22:21:21210 "target_unittest.cc",
[email protected]43bf6a52013-09-17 16:54:24211 "test_with_scope.cc",
212 "test_with_scope.h",
[email protected]ceb18412013-07-31 19:17:58213 "tokenizer_unittest.cc",
214 ]
215 deps = [
216 ":gn_lib",
[email protected]54837522013-12-21 17:56:38217 "//base/test:run_all_unittests",
218 "//base/test:test_support_base",
[email protected]23e197d2013-12-31 12:14:01219 "//testing/gtest",
[email protected]ceb18412013-07-31 19:17:58220 ]
221}
222
223executable("generate_test_gn_data") {
224 sources = [ "generate_test_gn_data.cc" ]
225 deps = [ "//base" ]
226}