[email protected] | e3730f81 | 2013-10-16 16:46:14 | [diff] [blame] | 1 | # 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 | |
| 5 | gyp_file = "gn.gyp" |
[email protected] | b2d5b0e | 2013-11-14 23:46:11 | [diff] [blame] | 6 | external = true |
[email protected] | e3730f81 | 2013-10-16 16:46:14 | [diff] [blame] | 7 | |
[email protected] | 3b4f1de | 2013-11-12 04:07:00 | [diff] [blame] | 8 | # 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). |
| 12 | if (!is_gyp) { |
| 13 | defines = [ "GN_BUILD" ] |
| 14 | } |
[email protected] | 9af0b83 | 2013-11-08 20:31:13 | [diff] [blame] | 15 | |
[email protected] | ceb1841 | 2013-07-31 19:17:58 | [diff] [blame] | 16 | static_library("gn_lib") { |
| 17 | sources = [ |
[email protected] | 60749e1c | 2013-08-19 21:11:05 | [diff] [blame] | 18 | "args.cc", |
| 19 | "args.h", |
[email protected] | c0822d7f | 2013-08-13 17:10:56 | [diff] [blame] | 20 | "binary_target_generator.cc", |
| 21 | "binary_target_generator.h", |
[email protected] | ceb1841 | 2013-07-31 19:17:58 | [diff] [blame] | 22 | "build_settings.cc", |
| 23 | "build_settings.h", |
[email protected] | 26542b0 | 2013-11-08 23:25:04 | [diff] [blame] | 24 | "builder.cc", |
| 25 | "builder.h", |
| 26 | "builder_record.cc", |
| 27 | "builder_record.h", |
[email protected] | 60749e1c | 2013-08-19 21:11:05 | [diff] [blame] | 28 | "command_args.cc", |
[email protected] | ceb1841 | 2013-07-31 19:17:58 | [diff] [blame] | 29 | "command_desc.cc", |
| 30 | "command_gen.cc", |
[email protected] | 0a79fe4 | 2013-08-29 21:06:26 | [diff] [blame] | 31 | "command_gyp.cc", |
[email protected] | ceb1841 | 2013-07-31 19:17:58 | [diff] [blame] | 32 | "command_help.cc", |
[email protected] | 60749e1c | 2013-08-19 21:11:05 | [diff] [blame] | 33 | "command_refs.cc", |
[email protected] | 93c19fd2 | 2013-08-06 19:34:44 | [diff] [blame] | 34 | "commands.cc", |
| 35 | "commands.h", |
[email protected] | ceb1841 | 2013-07-31 19:17:58 | [diff] [blame] | 36 | "config.cc", |
| 37 | "config.h", |
[email protected] | 93c19fd2 | 2013-08-06 19:34:44 | [diff] [blame] | 38 | "config_values.cc", |
[email protected] | ceb1841 | 2013-07-31 19:17:58 | [diff] [blame] | 39 | "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] | c0822d7f | 2013-08-13 17:10:56 | [diff] [blame] | 44 | "copy_target_generator.cc", |
| 45 | "copy_target_generator.h", |
[email protected] | ceb1841 | 2013-07-31 19:17:58 | [diff] [blame] | 46 | "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] | ea3690c | 2013-09-23 17:59:22 | [diff] [blame] | 60 | "function_rebase_path.cc", |
[email protected] | ceb1841 | 2013-07-31 19:17:58 | [diff] [blame] | 61 | "function_set_default_toolchain.cc", |
[email protected] | 6b4ee78 | 2013-08-20 17:13:24 | [diff] [blame] | 62 | "function_set_defaults.cc", |
[email protected] | ceb1841 | 2013-07-31 19:17:58 | [diff] [blame] | 63 | "function_template.cc", |
| 64 | "function_toolchain.cc", |
| 65 | "function_write_file.cc", |
[email protected] | c0822d7f | 2013-08-13 17:10:56 | [diff] [blame] | 66 | "group_target_generator.cc", |
| 67 | "group_target_generator.h", |
[email protected] | e3730f81 | 2013-10-16 16:46:14 | [diff] [blame] | 68 | "gyp_binary_target_writer.cc", |
| 69 | "gyp_binary_target_writer.h", |
| 70 | "gyp_helper.cc", |
| 71 | "gyp_helper.h", |
[email protected] | 05b94b43 | 2013-11-22 22:09:55 | [diff] [blame] | 72 | "gyp_script_target_writer.cc", |
| 73 | "gyp_script_target_writer.h", |
[email protected] | e3730f81 | 2013-10-16 16:46:14 | [diff] [blame] | 74 | "gyp_target_writer.cc", |
| 75 | "gyp_target_writer.h", |
[email protected] | ceb1841 | 2013-07-31 19:17:58 | [diff] [blame] | 76 | "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] | ceb1841 | 2013-07-31 19:17:58 | [diff] [blame] | 86 | "label.cc", |
| 87 | "label.h", |
[email protected] | 68d1dd3 | 2013-11-01 21:59:51 | [diff] [blame] | 88 | "label_ptr.h", |
[email protected] | 26542b0 | 2013-11-08 23:25:04 | [diff] [blame] | 89 | "loader.cc", |
| 90 | "loader.h", |
[email protected] | b0d3ad5d | 2013-09-16 23:31:36 | [diff] [blame] | 91 | "location.cc", |
[email protected] | ceb1841 | 2013-07-31 19:17:58 | [diff] [blame] | 92 | "location.h", |
[email protected] | c0822d7f | 2013-08-13 17:10:56 | [diff] [blame] | 93 | "ninja_binary_target_writer.cc", |
| 94 | "ninja_binary_target_writer.h", |
[email protected] | ceb1841 | 2013-07-31 19:17:58 | [diff] [blame] | 95 | "ninja_build_writer.cc", |
| 96 | "ninja_build_writer.h", |
[email protected] | c0822d7f | 2013-08-13 17:10:56 | [diff] [blame] | 97 | "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] | ceb1841 | 2013-07-31 19:17:58 | [diff] [blame] | 101 | "ninja_helper.cc", |
| 102 | "ninja_helper.h", |
[email protected] | c0822d7f | 2013-08-13 17:10:56 | [diff] [blame] | 103 | "ninja_script_target_writer.cc", |
| 104 | "ninja_script_target_writer.h", |
[email protected] | ceb1841 | 2013-07-31 19:17:58 | [diff] [blame] | 105 | "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] | c0822d7f | 2013-08-13 17:10:56 | [diff] [blame] | 128 | "script_target_generator.cc", |
| 129 | "script_target_generator.h", |
| 130 | "script_values.cc", |
| 131 | "script_values.h", |
[email protected] | ceb1841 | 2013-07-31 19:17:58 | [diff] [blame] | 132 | "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] | ceb1841 | 2013-07-31 19:17:58 | [diff] [blame] | 148 | "token.cc", |
| 149 | "token.h", |
| 150 | "tokenizer.cc", |
| 151 | "tokenizer.h", |
| 152 | "toolchain.cc", |
| 153 | "toolchain.h", |
[email protected] | 7f8c9fc | 2013-09-23 18:08:28 | [diff] [blame] | 154 | "trace.cc", |
| 155 | "trace.h", |
[email protected] | ceb1841 | 2013-07-31 19:17:58 | [diff] [blame] | 156 | "value.cc", |
| 157 | "value.h", |
| 158 | "value_extractors.cc", |
| 159 | "value_extractors.h", |
[email protected] | 4441041b | 2013-08-06 21:11:06 | [diff] [blame] | 160 | "variables.cc", |
| 161 | "variables.h", |
[email protected] | ceb1841 | 2013-07-31 19:17:58 | [diff] [blame] | 162 | ] |
[email protected] | 9af0b83 | 2013-11-08 20:31:13 | [diff] [blame] | 163 | |
[email protected] | ceb1841 | 2013-07-31 19:17:58 | [diff] [blame] | 164 | deps = [ |
| 165 | "//base", |
| 166 | "//base/third_party/dynamic_annotations", |
| 167 | ] |
| 168 | } |
| 169 | |
| 170 | executable("gn") { |
| 171 | sources = [ |
| 172 | "gn_main.cc", |
| 173 | ] |
[email protected] | 9af0b83 | 2013-11-08 20:31:13 | [diff] [blame] | 174 | |
[email protected] | ceb1841 | 2013-07-31 19:17:58 | [diff] [blame] | 175 | deps = [ |
| 176 | ":gn_lib", |
| 177 | ] |
[email protected] | 3b4f1de | 2013-11-12 04:07:00 | [diff] [blame] | 178 | if (!is_gyp) { |
| 179 | # Currently this only works in GYP (see GN_BUILD above). |
| 180 | deps += "//build/util:last_change" |
| 181 | } |
[email protected] | ceb1841 | 2013-07-31 19:17:58 | [diff] [blame] | 182 | } |
| 183 | |
| 184 | test("gn_unittests") { |
| 185 | sources = [ |
[email protected] | 26542b0 | 2013-11-08 23:25:04 | [diff] [blame] | 186 | "builder_unittest.cc", |
[email protected] | ceb1841 | 2013-07-31 19:17:58 | [diff] [blame] | 187 | "escape_unittest.cc", |
| 188 | "file_template_unittest.cc", |
| 189 | "filesystem_utils_unittest.cc", |
[email protected] | ea3690c | 2013-09-23 17:59:22 | [diff] [blame] | 190 | "function_rebase_path_unittest.cc", |
[email protected] | 05b94b43 | 2013-11-22 22:09:55 | [diff] [blame] | 191 | "gyp_script_target_writer_unittest.cc", |
[email protected] | ceb1841 | 2013-07-31 19:17:58 | [diff] [blame] | 192 | "input_conversion_unittest.cc", |
| 193 | "label_unittest.cc", |
[email protected] | 26542b0 | 2013-11-08 23:25:04 | [diff] [blame] | 194 | "loader_unittest.cc", |
[email protected] | 7ff2f5d | 2013-10-08 21:30:34 | [diff] [blame] | 195 | "ninja_binary_target_writer_unittest.cc", |
[email protected] | b90c75a | 2013-09-18 22:02:50 | [diff] [blame] | 196 | "ninja_copy_target_writer_unittest.cc", |
[email protected] | ceb1841 | 2013-07-31 19:17:58 | [diff] [blame] | 197 | "ninja_helper_unittest.cc", |
[email protected] | b90c75a | 2013-09-18 22:02:50 | [diff] [blame] | 198 | "ninja_script_target_writer_unittest.cc", |
[email protected] | 4419688 | 2013-12-21 05:31:11 | [diff] [blame] | 199 | "operators_unittest.cc", |
[email protected] | ceb1841 | 2013-07-31 19:17:58 | [diff] [blame] | 200 | "parser_unittest.cc", |
| 201 | "path_output_unittest.cc", |
| 202 | "pattern_unittest.cc", |
[email protected] | 17f43bf | 2013-08-23 21:04:46 | [diff] [blame] | 203 | "scope_per_file_provider_unittest.cc", |
[email protected] | a2d0b7a | 2013-12-16 23:59:09 | [diff] [blame] | 204 | "scope_unittest.cc", |
[email protected] | ceb1841 | 2013-07-31 19:17:58 | [diff] [blame] | 205 | "source_dir_unittest.cc", |
| 206 | "string_utils_unittest.cc", |
| 207 | "target_generator_unittest.cc", |
[email protected] | 3c1274d | 2013-09-10 22:21:21 | [diff] [blame] | 208 | "target_unittest.cc", |
[email protected] | 43bf6a5 | 2013-09-17 16:54:24 | [diff] [blame] | 209 | "test_with_scope.cc", |
| 210 | "test_with_scope.h", |
[email protected] | ceb1841 | 2013-07-31 19:17:58 | [diff] [blame] | 211 | "tokenizer_unittest.cc", |
| 212 | ] |
| 213 | deps = [ |
| 214 | ":gn_lib", |
[email protected] | 5483752 | 2013-12-21 17:56:38 | [diff] [blame] | 215 | "//base/test:run_all_unittests", |
| 216 | "//base/test:test_support_base", |
[email protected] | 23e197d | 2013-12-31 12:14:01 | [diff] [blame^] | 217 | "//testing/gtest", |
[email protected] | ceb1841 | 2013-07-31 19:17:58 | [diff] [blame] | 218 | ] |
| 219 | } |
| 220 | |
| 221 | executable("generate_test_gn_data") { |
| 222 | sources = [ "generate_test_gn_data.cc" ] |
| 223 | deps = [ "//base" ] |
| 224 | } |