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 # |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 "{{source_gen_dir}}/{{source_name_part}}.mojom.h", | 68 "{{source_gen_dir}}/{{source_name_part}}.mojom.h", |
69 "{{source_gen_dir}}/{{source_name_part}}.mojom-internal.h", | 69 "{{source_gen_dir}}/{{source_name_part}}.mojom-internal.h", |
70 ] | 70 ] |
71 generator_js_outputs = [ | 71 generator_js_outputs = [ |
72 "{{source_gen_dir}}/{{source_name_part}}.mojom.js", | 72 "{{source_gen_dir}}/{{source_name_part}}.mojom.js", |
73 ] | 73 ] |
74 generator_python_outputs = [ | 74 generator_python_outputs = [ |
75 "{{source_gen_dir}}/{{source_name_part}}_mojom.py", | 75 "{{source_gen_dir}}/{{source_name_part}}_mojom.py", |
76 ] | 76 ] |
77 | 77 |
78 target_visibility = ":$target_name" | 78 if (defined(invoker.visibility)) { |
| 79 # Need to save this because the the target_name is overwritten inside the |
| 80 # action to be that of the action itself. Only define this in the case the |
| 81 # var is used to avoid unused var error. |
| 82 target_visibility = [ ":$target_name" ] |
| 83 } |
79 | 84 |
80 generator_target_name = target_name + "_generator" | 85 generator_target_name = target_name + "_generator" |
81 action_foreach(generator_target_name) { | 86 action_foreach(generator_target_name) { |
82 visibility = target_visibility | 87 if (defined(invoker.visibility)) { |
| 88 visibility = target_visibility + invoker.visibility |
| 89 } |
83 script = generator_script | 90 script = generator_script |
84 inputs = generator_sources | 91 inputs = generator_sources |
85 sources = invoker.sources | 92 sources = invoker.sources |
86 outputs = generator_cpp_outputs + | 93 outputs = generator_cpp_outputs + |
87 generator_js_outputs + | 94 generator_js_outputs + |
88 generator_python_outputs | 95 generator_python_outputs |
89 args = [ | 96 args = [ |
90 "{{source}}", | 97 "{{source}}", |
91 "--use_chromium_bundled_pylibs", | 98 "--use_chromium_bundled_pylibs", |
92 "-d", rebase_path("//", root_build_dir), | 99 "-d", rebase_path("//", root_build_dir), |
(...skipping 10 matching lines...) Expand all Loading... |
103 data = process_file_template(invoker.sources, generator_js_outputs) | 110 data = process_file_template(invoker.sources, generator_js_outputs) |
104 deps = [ | 111 deps = [ |
105 ":$generator_target_name", | 112 ":$generator_target_name", |
106 "//mojo/public/cpp/bindings", | 113 "//mojo/public/cpp/bindings", |
107 ] | 114 ] |
108 if (defined(invoker.deps)) { | 115 if (defined(invoker.deps)) { |
109 deps += invoker.deps | 116 deps += invoker.deps |
110 } | 117 } |
111 } | 118 } |
112 } | 119 } |
OLD | NEW |