| 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 # |
| 16 # testonly (optional) |
| 17 # |
| 16 # visibility (optional) | 18 # visibility (optional) |
| 17 # Normal meaning. However, this must be a list (normal visibility | 19 # Normal meaning. However, this must be a list (normal visibility |
| 18 # allows a single string). | 20 # allows a single string). |
| 19 template("mojom") { | 21 template("mojom") { |
| 20 assert(defined(invoker.sources), | 22 assert(defined(invoker.sources), |
| 21 "\"sources\" must be defined for the $target_name template.") | 23 "\"sources\" must be defined for the $target_name template.") |
| 22 | 24 |
| 23 generator_root = "//mojo/public/tools/bindings" | 25 generator_root = "//mojo/public/tools/bindings" |
| 24 generator_script = "$generator_root/mojom_bindings_generator.py" | 26 generator_script = "$generator_root/mojom_bindings_generator.py" |
| 25 generator_sources = [ | 27 generator_sources = [ |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 "-d", rebase_path("//", root_build_dir), | 104 "-d", rebase_path("//", root_build_dir), |
| 103 "-I", rebase_path("//", root_build_dir), | 105 "-I", rebase_path("//", root_build_dir), |
| 104 "-o", "{{source_gen_dir}}", | 106 "-o", "{{source_gen_dir}}", |
| 105 ] | 107 ] |
| 106 } | 108 } |
| 107 | 109 |
| 108 source_set(target_name) { | 110 source_set(target_name) { |
| 109 if (defined(invoker.visibility)) { | 111 if (defined(invoker.visibility)) { |
| 110 visibility = invoker.visibility | 112 visibility = invoker.visibility |
| 111 } | 113 } |
| 114 if (defined(invoker.testonly)) { |
| 115 testonly = invoker.testonly |
| 116 } |
| 112 sources = process_file_template(invoker.sources, generator_cpp_outputs) | 117 sources = process_file_template(invoker.sources, generator_cpp_outputs) |
| 113 data = process_file_template(invoker.sources, generator_js_outputs) | 118 data = process_file_template(invoker.sources, generator_js_outputs) |
| 114 deps = [ | 119 deps = [ |
| 115 ":$generator_target_name", | 120 ":$generator_target_name", |
| 116 "//mojo/public/cpp/bindings", | 121 "//mojo/public/cpp/bindings", |
| 117 ] | 122 ] |
| 118 if (defined(invoker.deps)) { | 123 if (defined(invoker.deps)) { |
| 119 deps += invoker.deps | 124 deps += invoker.deps |
| 120 } | 125 } |
| 121 } | 126 } |
| 122 } | 127 } |
| OLD | NEW |