blob: 567f1e9ffd39d5ff0563f03c78724311f7350ba6 [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",
72 "gyp_target_writer.cc",
73 "gyp_target_writer.h",
[email protected]ceb18412013-07-31 19:17:5874 "import_manager.cc",
75 "import_manager.h",
76 "input_conversion.cc",
77 "input_conversion.h",
78 "input_file.cc",
79 "input_file.h",
80 "input_file_manager.cc",
81 "input_file_manager.h",
82 "item.cc",
83 "item.h",
[email protected]ceb18412013-07-31 19:17:5884 "label.cc",
85 "label.h",
[email protected]68d1dd32013-11-01 21:59:5186 "label_ptr.h",
[email protected]26542b02013-11-08 23:25:0487 "loader.cc",
88 "loader.h",
[email protected]b0d3ad5d2013-09-16 23:31:3689 "location.cc",
[email protected]ceb18412013-07-31 19:17:5890 "location.h",
[email protected]c0822d7f2013-08-13 17:10:5691 "ninja_binary_target_writer.cc",
92 "ninja_binary_target_writer.h",
[email protected]ceb18412013-07-31 19:17:5893 "ninja_build_writer.cc",
94 "ninja_build_writer.h",
[email protected]c0822d7f2013-08-13 17:10:5695 "ninja_copy_target_writer.cc",
96 "ninja_copy_target_writer.h",
97 "ninja_group_target_writer.cc",
98 "ninja_group_target_writer.h",
[email protected]ceb18412013-07-31 19:17:5899 "ninja_helper.cc",
100 "ninja_helper.h",
[email protected]c0822d7f2013-08-13 17:10:56101 "ninja_script_target_writer.cc",
102 "ninja_script_target_writer.h",
[email protected]ceb18412013-07-31 19:17:58103 "ninja_target_writer.cc",
104 "ninja_target_writer.h",
105 "ninja_toolchain_writer.cc",
106 "ninja_toolchain_writer.h",
107 "ninja_writer.cc",
108 "ninja_writer.h",
109 "operators.cc",
110 "operators.h",
111 "output_file.h",
112 "parse_tree.cc",
113 "parse_tree.h",
114 "parser.cc",
115 "parser.h",
116 "path_output.cc",
117 "path_output.h",
118 "pattern.cc",
119 "pattern.h",
120 "scheduler.cc",
121 "scheduler.h",
122 "scope.cc",
123 "scope.h",
124 "scope_per_file_provider.cc",
125 "scope_per_file_provider.h",
[email protected]c0822d7f2013-08-13 17:10:56126 "script_target_generator.cc",
127 "script_target_generator.h",
128 "script_values.cc",
129 "script_values.h",
[email protected]ceb18412013-07-31 19:17:58130 "settings.cc",
131 "settings.h",
132 "setup.cc",
133 "setup.h",
134 "source_dir.cc",
135 "source_dir.h",
136 "source_file.cc",
137 "source_file.h",
138 "standard_out.cc",
139 "standard_out.h",
140 "string_utils.cc",
141 "string_utils.h",
142 "target.cc",
143 "target.h",
144 "target_generator.cc",
145 "target_generator.h",
[email protected]ceb18412013-07-31 19:17:58146 "token.cc",
147 "token.h",
148 "tokenizer.cc",
149 "tokenizer.h",
150 "toolchain.cc",
151 "toolchain.h",
[email protected]7f8c9fc2013-09-23 18:08:28152 "trace.cc",
153 "trace.h",
[email protected]ceb18412013-07-31 19:17:58154 "value.cc",
155 "value.h",
156 "value_extractors.cc",
157 "value_extractors.h",
[email protected]4441041b2013-08-06 21:11:06158 "variables.cc",
159 "variables.h",
[email protected]ceb18412013-07-31 19:17:58160 ]
[email protected]9af0b832013-11-08 20:31:13161
[email protected]ceb18412013-07-31 19:17:58162 deps = [
163 "//base",
164 "//base/third_party/dynamic_annotations",
[email protected]ceb18412013-07-31 19:17:58165 ]
166}
167
168executable("gn") {
169 sources = [
170 "gn_main.cc",
171 ]
[email protected]9af0b832013-11-08 20:31:13172
[email protected]ceb18412013-07-31 19:17:58173 deps = [
174 ":gn_lib",
175 ]
[email protected]3b4f1de2013-11-12 04:07:00176 if (!is_gyp) {
177 # Currently this only works in GYP (see GN_BUILD above).
178 deps += "//build/util:last_change"
179 }
[email protected]ceb18412013-07-31 19:17:58180}
181
182test("gn_unittests") {
183 sources = [
[email protected]26542b02013-11-08 23:25:04184 "builder_unittest.cc",
[email protected]ceb18412013-07-31 19:17:58185 "escape_unittest.cc",
186 "file_template_unittest.cc",
187 "filesystem_utils_unittest.cc",
[email protected]ea3690c2013-09-23 17:59:22188 "function_rebase_path_unittest.cc",
[email protected]ceb18412013-07-31 19:17:58189 "input_conversion_unittest.cc",
190 "label_unittest.cc",
[email protected]26542b02013-11-08 23:25:04191 "loader_unittest.cc",
[email protected]7ff2f5d2013-10-08 21:30:34192 "ninja_binary_target_writer_unittest.cc",
[email protected]b90c75a2013-09-18 22:02:50193 "ninja_copy_target_writer_unittest.cc",
[email protected]ceb18412013-07-31 19:17:58194 "ninja_helper_unittest.cc",
[email protected]b90c75a2013-09-18 22:02:50195 "ninja_script_target_writer_unittest.cc",
[email protected]ceb18412013-07-31 19:17:58196 "parser_unittest.cc",
197 "path_output_unittest.cc",
198 "pattern_unittest.cc",
[email protected]17f43bf2013-08-23 21:04:46199 "scope_per_file_provider_unittest.cc",
[email protected]ceb18412013-07-31 19:17:58200 "source_dir_unittest.cc",
201 "string_utils_unittest.cc",
202 "target_generator_unittest.cc",
[email protected]3c1274d2013-09-10 22:21:21203 "target_unittest.cc",
[email protected]43bf6a52013-09-17 16:54:24204 "test_with_scope.cc",
205 "test_with_scope.h",
[email protected]ceb18412013-07-31 19:17:58206 "tokenizer_unittest.cc",
207 ]
208 deps = [
209 ":gn_lib",
[email protected]0a79fe42013-08-29 21:06:26210 "//base:run_all_unittests",
211 "//base:test_support_base",
212 "//testing:gtest",
[email protected]ceb18412013-07-31 19:17:58213 ]
214}
215
216executable("generate_test_gn_data") {
217 sources = [ "generate_test_gn_data.cc" ]
218 deps = [ "//base" ]
219}