blob: ccb8024ea04e2de45c1f2188f59583c106c326b6 [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]60749e1c2013-08-19 21:11:0518 "args.cc",
19 "args.h",
[email protected]c0822d7f2013-08-13 17:10:5620 "binary_target_generator.cc",
21 "binary_target_generator.h",
[email protected]ceb18412013-07-31 19:17:5822 "build_settings.cc",
23 "build_settings.h",
[email protected]26542b02013-11-08 23:25:0424 "builder.cc",
25 "builder.h",
26 "builder_record.cc",
27 "builder_record.h",
[email protected]60749e1c2013-08-19 21:11:0528 "command_args.cc",
[email protected]ceb18412013-07-31 19:17:5829 "command_desc.cc",
30 "command_gen.cc",
[email protected]0a79fe42013-08-29 21:06:2631 "command_gyp.cc",
[email protected]ceb18412013-07-31 19:17:5832 "command_help.cc",
[email protected]60749e1c2013-08-19 21:11:0533 "command_refs.cc",
[email protected]93c19fd22013-08-06 19:34:4434 "commands.cc",
35 "commands.h",
[email protected]ceb18412013-07-31 19:17:5836 "config.cc",
37 "config.h",
[email protected]93c19fd22013-08-06 19:34:4438 "config_values.cc",
[email protected]ceb18412013-07-31 19:17:5839 "config_values.h",
40 "config_values_extractors.cc",
41 "config_values_extractors.h",
42 "config_values_generator.cc",
43 "config_values_generator.h",
[email protected]c0822d7f2013-08-13 17:10:5644 "copy_target_generator.cc",
45 "copy_target_generator.h",
[email protected]ceb18412013-07-31 19:17:5846 "err.cc",
47 "err.h",
48 "escape.cc",
49 "escape.h",
50 "file_template.cc",
51 "file_template.h",
52 "filesystem_utils.cc",
53 "filesystem_utils.h",
54 "functions.cc",
55 "functions.h",
56 "functions_target.cc",
57 "function_exec_script.cc",
58 "function_process_file_template.cc",
59 "function_read_file.cc",
[email protected]ea3690c2013-09-23 17:59:2260 "function_rebase_path.cc",
[email protected]ceb18412013-07-31 19:17:5861 "function_set_default_toolchain.cc",
[email protected]6b4ee782013-08-20 17:13:2462 "function_set_defaults.cc",
[email protected]ceb18412013-07-31 19:17:5863 "function_template.cc",
64 "function_toolchain.cc",
65 "function_write_file.cc",
[email protected]c0822d7f2013-08-13 17:10:5666 "group_target_generator.cc",
67 "group_target_generator.h",
[email protected]e3730f812013-10-16 16:46:1468 "gyp_binary_target_writer.cc",
69 "gyp_binary_target_writer.h",
70 "gyp_helper.cc",
71 "gyp_helper.h",
[email protected]05b94b432013-11-22 22:09:5572 "gyp_script_target_writer.cc",
73 "gyp_script_target_writer.h",
[email protected]e3730f812013-10-16 16:46:1474 "gyp_target_writer.cc",
75 "gyp_target_writer.h",
[email protected]ceb18412013-07-31 19:17:5876 "import_manager.cc",
77 "import_manager.h",
78 "input_conversion.cc",
79 "input_conversion.h",
80 "input_file.cc",
81 "input_file.h",
82 "input_file_manager.cc",
83 "input_file_manager.h",
84 "item.cc",
85 "item.h",
[email protected]ceb18412013-07-31 19:17:5886 "label.cc",
87 "label.h",
[email protected]68d1dd32013-11-01 21:59:5188 "label_ptr.h",
[email protected]26542b02013-11-08 23:25:0489 "loader.cc",
90 "loader.h",
[email protected]b0d3ad5d2013-09-16 23:31:3691 "location.cc",
[email protected]ceb18412013-07-31 19:17:5892 "location.h",
[email protected]c0822d7f2013-08-13 17:10:5693 "ninja_binary_target_writer.cc",
94 "ninja_binary_target_writer.h",
[email protected]ceb18412013-07-31 19:17:5895 "ninja_build_writer.cc",
96 "ninja_build_writer.h",
[email protected]c0822d7f2013-08-13 17:10:5697 "ninja_copy_target_writer.cc",
98 "ninja_copy_target_writer.h",
99 "ninja_group_target_writer.cc",
100 "ninja_group_target_writer.h",
[email protected]ceb18412013-07-31 19:17:58101 "ninja_helper.cc",
102 "ninja_helper.h",
[email protected]c0822d7f2013-08-13 17:10:56103 "ninja_script_target_writer.cc",
104 "ninja_script_target_writer.h",
[email protected]ceb18412013-07-31 19:17:58105 "ninja_target_writer.cc",
106 "ninja_target_writer.h",
107 "ninja_toolchain_writer.cc",
108 "ninja_toolchain_writer.h",
109 "ninja_writer.cc",
110 "ninja_writer.h",
111 "operators.cc",
112 "operators.h",
113 "output_file.h",
114 "parse_tree.cc",
115 "parse_tree.h",
116 "parser.cc",
117 "parser.h",
118 "path_output.cc",
119 "path_output.h",
120 "pattern.cc",
121 "pattern.h",
122 "scheduler.cc",
123 "scheduler.h",
124 "scope.cc",
125 "scope.h",
126 "scope_per_file_provider.cc",
127 "scope_per_file_provider.h",
[email protected]c0822d7f2013-08-13 17:10:56128 "script_target_generator.cc",
129 "script_target_generator.h",
130 "script_values.cc",
131 "script_values.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).
180 deps += "//build/util:last_change"
181 }
[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",
188 "file_template_unittest.cc",
189 "filesystem_utils_unittest.cc",
[email protected]ea3690c2013-09-23 17:59:22190 "function_rebase_path_unittest.cc",
[email protected]05b94b432013-11-22 22:09:55191 "gyp_script_target_writer_unittest.cc",
[email protected]ceb18412013-07-31 19:17:58192 "input_conversion_unittest.cc",
193 "label_unittest.cc",
[email protected]26542b02013-11-08 23:25:04194 "loader_unittest.cc",
[email protected]7ff2f5d2013-10-08 21:30:34195 "ninja_binary_target_writer_unittest.cc",
[email protected]b90c75a2013-09-18 22:02:50196 "ninja_copy_target_writer_unittest.cc",
[email protected]ceb18412013-07-31 19:17:58197 "ninja_helper_unittest.cc",
[email protected]b90c75a2013-09-18 22:02:50198 "ninja_script_target_writer_unittest.cc",
[email protected]44196882013-12-21 05:31:11199 "operators_unittest.cc",
[email protected]ceb18412013-07-31 19:17:58200 "parser_unittest.cc",
201 "path_output_unittest.cc",
202 "pattern_unittest.cc",
[email protected]17f43bf2013-08-23 21:04:46203 "scope_per_file_provider_unittest.cc",
[email protected]a2d0b7a2013-12-16 23:59:09204 "scope_unittest.cc",
[email protected]ceb18412013-07-31 19:17:58205 "source_dir_unittest.cc",
206 "string_utils_unittest.cc",
207 "target_generator_unittest.cc",
[email protected]3c1274d2013-09-10 22:21:21208 "target_unittest.cc",
[email protected]43bf6a52013-09-17 16:54:24209 "test_with_scope.cc",
210 "test_with_scope.h",
[email protected]ceb18412013-07-31 19:17:58211 "tokenizer_unittest.cc",
212 ]
213 deps = [
214 ":gn_lib",
[email protected]54837522013-12-21 17:56:38215 "//base/test:run_all_unittests",
216 "//base/test:test_support_base",
[email protected]23e197d2013-12-31 12:14:01217 "//testing/gtest",
[email protected]ceb18412013-07-31 19:17:58218 ]
219}
220
221executable("generate_test_gn_data") {
222 sources = [ "generate_test_gn_data.cc" ]
223 deps = [ "//base" ]
224}