Chromium Code Reviews| Index: third_party/protobuf/proto_library.gni |
| diff --git a/third_party/protobuf/proto_library.gni b/third_party/protobuf/proto_library.gni |
| index df9d657bf46aa0366f9681f45db30cc5db87fb42..13a64f930f48dd9a35206c8e4241b4a161b2cc07 100644 |
| --- a/third_party/protobuf/proto_library.gni |
| +++ b/third_party/protobuf/proto_library.gni |
| @@ -25,6 +25,9 @@ |
| # It is likely you also need to #include a file for the above EXPORT |
| # macro to work. See cc_include. |
| # |
| +# cc_generator_plugin (optional) |
| +# Plugin executable name. Expected .pb.h and .pb.cc as output. |
|
xyzzyz
2016/06/20 20:17:46
If you drop the requirement that the plugin output
kraynov
2016/06/20 20:19:47
Acknowledged.
|
| +# |
| # cc_include (optional) |
| # String listing an extra include that should be passed. |
| # Example: cc_include = "foo/bar.h" |
| @@ -100,6 +103,11 @@ template("proto_library") { |
| ] |
| } |
| + if (defined(invoker.cc_generator_plugin)) { |
| + cc_generator_plugin = invoker.cc_generator_plugin |
| + } else { |
| + cc_generator_plugin = "" |
| + } |
| args += [ |
| "--protobuf", |
| "$rel_out_dir/{{source_name_part}}.pb.h", |
| @@ -107,6 +115,7 @@ template("proto_library") { |
| "{{source_dir}}", |
| "--proto-in-file", |
| "{{source_file_part}}", |
| + "--cc-generator-plugin=$cc_generator_plugin", |
| # TODO(brettw) support system protobuf compiler. |
| "--use-system-protobuf=0", |
| @@ -165,11 +174,14 @@ template("proto_library") { |
| public_configs = [ "//third_party/protobuf:using_proto" ] |
| - public_deps = [ |
| - # The generated headers reference headers within protobuf_lite, so |
| - # dependencies must be able to find those headers too. |
| - "//third_party/protobuf:protobuf_lite", |
| - ] |
| + # If using built-in cc generator the resulting headers reference headers |
| + # within protobuf_lite, hence dependencies require those headers too. |
| + # In case of generator plugin such issues should be resolved by invoker. |
| + if (!defined(invoker.cc_generator_plugin)) { |
| + public_deps = [ |
| + "//third_party/protobuf:protobuf_lite", |
| + ] |
| + } |
| deps = [ |
| ":$action_name", |
| ] |