OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import("../../mojo_sdk.gni") | 5 import("../../mojo_sdk.gni") |
6 | 6 |
7 # Generate C++ and JavaScript source files from mojom files. The output files | 7 # Generate C++ and JavaScript source files from mojom files. The output files |
8 # will go under the generated file directory tree with the same path as each | 8 # will go under the generated file directory tree with the same path as each |
9 # input file. | 9 # input file. |
10 # | 10 # |
(...skipping 17 matching lines...) Expand all Loading... |
28 # current directory. | 28 # current directory. |
29 # | 29 # |
30 # public_deps (optional) | 30 # public_deps (optional) |
31 # Note: this can contain only other mojom targets. | 31 # Note: this can contain only other mojom targets. |
32 # | 32 # |
33 # mojo_sdk_public_deps (optional) | 33 # mojo_sdk_public_deps (optional) |
34 # List of public deps specified relative to the parent directory of the | 34 # List of public deps specified relative to the parent directory of the |
35 # Mojo public SDK. These deps will be added as ordinary public deps | 35 # Mojo public SDK. These deps will be added as ordinary public deps |
36 # rebased to the current directory. | 36 # rebased to the current directory. |
37 # | 37 # |
| 38 # import_dirs (optional) |
| 39 # List of import directories that will get added when processing sources. |
| 40 # |
38 # testonly (optional) | 41 # testonly (optional) |
39 # | 42 # |
40 # visibility (optional) | 43 # visibility (optional) |
41 template("mojom") { | 44 template("mojom") { |
42 assert(defined(invoker.sources), | 45 assert(defined(invoker.sources), |
43 "\"sources\" must be defined for the $target_name template.") | 46 "\"sources\" must be defined for the $target_name template.") |
44 | 47 |
45 generator_root = rebase_path("mojo/public/tools/bindings", ".", mojo_root) | 48 generator_root = rebase_path("mojo/public/tools/bindings", ".", mojo_root) |
46 generator_script = "$generator_root/mojom_bindings_generator.py" | 49 generator_script = "$generator_root/mojom_bindings_generator.py" |
47 generator_sources = [ | 50 generator_sources = [ |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 "--use_bundled_pylibs", | 151 "--use_bundled_pylibs", |
149 "-d", | 152 "-d", |
150 rebase_path("//", root_build_dir), | 153 rebase_path("//", root_build_dir), |
151 "-I", | 154 "-I", |
152 rebase_path("//", root_build_dir), | 155 rebase_path("//", root_build_dir), |
153 "-I", | 156 "-I", |
154 rebase_path(mojo_root, root_build_dir), | 157 rebase_path(mojo_root, root_build_dir), |
155 "-o", | 158 "-o", |
156 rebase_path(root_gen_dir), | 159 rebase_path(root_gen_dir), |
157 ] | 160 ] |
| 161 |
| 162 if (defined(invoker.import_dirs)) { |
| 163 foreach(import_dir, invoker.import_dirs) { |
| 164 args += [ |
| 165 "-I", |
| 166 rebase_path(import_dir, root_build_dir), |
| 167 ] |
| 168 } |
| 169 } |
158 } | 170 } |
159 | 171 |
160 source_set(target_name) { | 172 source_set(target_name) { |
161 if (defined(invoker.visibility)) { | 173 if (defined(invoker.visibility)) { |
162 visibility = invoker.visibility | 174 visibility = invoker.visibility |
163 } | 175 } |
164 if (defined(invoker.testonly)) { | 176 if (defined(invoker.testonly)) { |
165 testonly = invoker.testonly | 177 testonly = invoker.testonly |
166 } | 178 } |
167 sources = process_file_template(invoker.sources, generator_cpp_outputs) | 179 sources = process_file_template(invoker.sources, generator_cpp_outputs) |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 # //mojo/something:something and we can append "_java" to get the java | 248 # //mojo/something:something and we can append "_java" to get the java |
237 # dependency name. | 249 # dependency name. |
238 full_name = get_label_info(d, "label_no_toolchain") | 250 full_name = get_label_info(d, "label_no_toolchain") |
239 deps += [ "${full_name}_java" ] | 251 deps += [ "${full_name}_java" ] |
240 } | 252 } |
241 | 253 |
242 srcjars = process_file_template(invoker.sources, generator_java_outputs) | 254 srcjars = process_file_template(invoker.sources, generator_java_outputs) |
243 } | 255 } |
244 } | 256 } |
245 } | 257 } |
OLD | NEW |