Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(112)

Unified Diff: third_party/protobuf/proto_library.gni

Issue 2427943002: Explicit dependency on executables in proto_library.gni. (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698