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. | 5 # Generate C++ and JavaScript source files from mojom files. |
6 template("mojom") { | 6 template("mojom") { |
7 assert(defined(invoker.sources), | 7 assert(defined(invoker.sources), |
8 "\"sources\" must be defined for the $target_name template.") | 8 "\"sources\" must be defined for the $target_name template.") |
9 | 9 |
10 generator_root = "//mojo/public/tools/bindings" | 10 generator_root = "//mojo/public/tools/bindings" |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 outputs = generator_cpp_outputs + generator_js_outputs | 70 outputs = generator_cpp_outputs + generator_js_outputs |
71 args = [ | 71 args = [ |
72 "{{source}}", | 72 "{{source}}", |
73 "--use_chromium_bundled_pylibs", | 73 "--use_chromium_bundled_pylibs", |
74 "-d", rebase_path("//", root_build_dir), | 74 "-d", rebase_path("//", root_build_dir), |
75 "-o", rebase_path(target_gen_dir, root_build_dir), | 75 "-o", rebase_path(target_gen_dir, root_build_dir), |
76 ] | 76 ] |
77 } | 77 } |
78 | 78 |
79 source_set(target_name) { | 79 source_set(target_name) { |
| 80 if (defined(invoker.visibility)) { |
| 81 visibility = invoker.visibility |
| 82 } |
80 sources = process_file_template(invoker.sources, generator_cpp_outputs) | 83 sources = process_file_template(invoker.sources, generator_cpp_outputs) |
81 data = process_file_template(invoker.sources, generator_js_outputs) | 84 data = process_file_template(invoker.sources, generator_js_outputs) |
82 deps = [ | 85 deps = [ |
83 ":$generator_target_name", | 86 ":$generator_target_name", |
84 "//mojo/public/cpp/bindings", | 87 "//mojo/public/cpp/bindings", |
85 ] | 88 ] |
86 } | 89 } |
87 } | 90 } |
OLD | NEW |