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 cca81063760ce01c567c66bdd855e5c4ab6dacef..be208e85de6e68139f5c2be9a9c0f39adabdb727 100644 |
| --- a/third_party/protobuf/proto_library.gni |
| +++ b/third_party/protobuf/proto_library.gni |
| @@ -133,7 +133,6 @@ template("proto_library") { |
| } else { |
| generator_plugin_suffixes = invoker.generator_plugin_suffixes |
| } |
| - plugin_path = rebase_path(plugin_path, root_build_dir) |
| } |
| if (defined(invoker.proto_in_dir)) { |
| @@ -216,23 +215,18 @@ template("proto_library") { |
| outputs = get_path_info(protogens, "abspath") |
| args = protos |
| - if (defined(invoker.generator_plugin_script)) { |
| - inputs = [ |
| - invoker.generator_plugin_script, |
|
kraynov
2016/10/18 12:35:52
It's not missing :)
invoker.generator_plugin_scrip
sdefresne
2016/10/18 22:44:54
Ack.
|
| - ] |
| - } |
| - if (defined(invoker.generator_plugin_script_deps)) { |
| - inputs += invoker.generator_plugin_script_deps |
| + protoc_label = "//third_party/protobuf:protoc($host_toolchain)" |
| + protoc_path = get_label_info(protoc_label, "root_out_dir") + "/protoc" |
|
sdefresne
2016/10/18 22:44:54
protoc_path = get_label_info(protoc_label, "root_o
kraynov
2016/10/19 11:04:59
Done.
|
| + if (host_os == "win") { |
| + protoc_path += ".exe" |
| } |
| - protoc_label = "//third_party/protobuf:protoc($host_toolchain)" |
| - protoc_out_dir = get_label_info(protoc_label, "root_out_dir") |
| args += [ |
| # Wrapper should never pick a system protoc. |
| # Path should be rebased because |root_build_dir| for current toolchain |
| # may be different from |root_out_dir| of protoc built on host toolchain. |
| "--protoc", |
| - "./" + rebase_path(protoc_out_dir, root_build_dir) + "/protoc", |
| + rebase_path(protoc_path, root_build_dir), |
| "--proto-in-dir", |
| rebase_path(proto_in_dir, root_build_dir), |
| ] |
| @@ -266,7 +260,7 @@ template("proto_library") { |
| if (generate_with_plugin) { |
| args += [ |
| "--plugin", |
| - plugin_path, |
| + rebase_path(plugin_path, root_build_dir), |
| "--plugin-out-dir", |
| rel_cc_out_dir, |
| ] |
| @@ -278,14 +272,26 @@ template("proto_library") { |
| } |
| } |
| + # System protoc is not used so it's necessary to build a chromium one. |
| + inputs = [ |
| + protoc_path, |
| + ] |
| deps = [ |
| - # System protoc is not used so it's necessary to build a chromium one. |
| protoc_label, |
| ] |
| - if (defined(plugin_host_label)) { |
| - # Action depends on generator plugin but for host toolchain only. |
| - deps += [ plugin_host_label ] |
| + |
| + if (generate_with_plugin) { |
| + inputs += [ plugin_path ] |
| + if (defined(invoker.generator_plugin_script_deps)) { |
| + # Additional scripts for plugin. |
| + inputs += invoker.generator_plugin_script_deps |
| + } |
| + if (defined(plugin_host_label)) { |
| + # Action depends on native generator plugin but for host toolchain only. |
| + deps += [ plugin_host_label ] |
| + } |
| } |
| + |
| if (defined(invoker.deps)) { |
| # The deps may have steps that have to run before running protoc. |
| deps += invoker.deps |