| 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 # Generate C++ and JavaScript source files from mojom files. The output files | 5 # Generate C++ and JavaScript source files from mojom files. The output files |
| 6 # will go under the generated file directory tree with the same path as each | 6 # will go under the generated file directory tree with the same path as each |
| 7 # input file. | 7 # input file. |
| 8 # | 8 # |
| 9 # Parameters: | 9 # Parameters: |
| 10 # | 10 # |
| 11 # sources (required) | 11 # sources (required) |
| 12 # List of source .mojom files to compile. | 12 # List of source .mojom files to compile. |
| 13 # | 13 # |
| 14 # deps (optional) | 14 # deps (optional) |
| 15 # |
| 15 # visibility (optional) | 16 # visibility (optional) |
| 16 # Normal meaning. | 17 # Normal meaning. However, this must be a list (normal visibility |
| 18 # allows a single string). |
| 17 template("mojom") { | 19 template("mojom") { |
| 18 assert(defined(invoker.sources), | 20 assert(defined(invoker.sources), |
| 19 "\"sources\" must be defined for the $target_name template.") | 21 "\"sources\" must be defined for the $target_name template.") |
| 20 | 22 |
| 21 generator_root = "//mojo/public/tools/bindings" | 23 generator_root = "//mojo/public/tools/bindings" |
| 22 generator_script = "$generator_root/mojom_bindings_generator.py" | 24 generator_script = "$generator_root/mojom_bindings_generator.py" |
| 23 generator_sources = [ | 25 generator_sources = [ |
| 24 generator_script, | 26 generator_script, |
| 25 "$generator_root/generators/cpp_templates/enum_declaration.tmpl", | 27 "$generator_root/generators/cpp_templates/enum_declaration.tmpl", |
| 26 "$generator_root/generators/cpp_templates/interface_declaration.tmpl", | 28 "$generator_root/generators/cpp_templates/interface_declaration.tmpl", |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 data = process_file_template(invoker.sources, generator_js_outputs) | 112 data = process_file_template(invoker.sources, generator_js_outputs) |
| 111 deps = [ | 113 deps = [ |
| 112 ":$generator_target_name", | 114 ":$generator_target_name", |
| 113 "//mojo/public/cpp/bindings", | 115 "//mojo/public/cpp/bindings", |
| 114 ] | 116 ] |
| 115 if (defined(invoker.deps)) { | 117 if (defined(invoker.deps)) { |
| 116 deps += invoker.deps | 118 deps += invoker.deps |
| 117 } | 119 } |
| 118 } | 120 } |
| 119 } | 121 } |
| OLD | NEW |