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 # Compile a protocol buffer. | 5 # Compile a protocol buffer. |
6 # | 6 # |
7 # Protobuf parameters: | 7 # Protobuf parameters: |
8 # | 8 # |
9 # proto_out_dir (optional) | 9 # proto_out_dir (optional) |
10 # Specifies the path suffix that output files are generated under. This | 10 # Specifies the path suffix that output files are generated under. This |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 # "foo.proto", | 48 # "foo.proto", |
49 # ] | 49 # ] |
50 # } | 50 # } |
51 | 51 |
52 template("proto_library") { | 52 template("proto_library") { |
53 assert(defined(invoker.sources), "Need sources for proto_library") | 53 assert(defined(invoker.sources), "Need sources for proto_library") |
54 | 54 |
55 action_name = "${target_name}_gen" | 55 action_name = "${target_name}_gen" |
56 source_set_name = target_name | 56 source_set_name = target_name |
57 action_foreach(action_name) { | 57 action_foreach(action_name) { |
58 visibility = ":$source_set_name" | 58 visibility = [ ":$source_set_name" ] |
59 | 59 |
60 script = "//tools/protoc_wrapper/protoc_wrapper.py" | 60 script = "//tools/protoc_wrapper/protoc_wrapper.py" |
61 | 61 |
62 sources = invoker.sources | 62 sources = invoker.sources |
63 | 63 |
64 # Compute the output directory, both relative to the source root (for | 64 # Compute the output directory, both relative to the source root (for |
65 # declaring "outputs") and relative to the build dir (for passing to the | 65 # declaring "outputs") and relative to the build dir (for passing to the |
66 # script). | 66 # script). |
67 if (defined(invoker.proto_out_dir)) { | 67 if (defined(invoker.proto_out_dir)) { |
68 # Put the results in the specified dir in the gen tree. | 68 # Put the results in the specified dir in the gen tree. |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 deps = [ | 145 deps = [ |
146 ":$action_name", | 146 ":$action_name", |
147 "//third_party/protobuf:protobuf_lite", | 147 "//third_party/protobuf:protobuf_lite", |
148 ] | 148 ] |
149 | 149 |
150 # The generated headers reference headers within protobuf_lite, so | 150 # The generated headers reference headers within protobuf_lite, so |
151 # dependencies must be able to find those headers too. | 151 # dependencies must be able to find those headers too. |
152 forward_dependent_configs_from = [ "//third_party/protobuf:protobuf_lite" ] | 152 forward_dependent_configs_from = [ "//third_party/protobuf:protobuf_lite" ] |
153 } | 153 } |
154 } | 154 } |
OLD | NEW |