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

Unified Diff: third_party/protobuf/proto_library.gni

Issue 2082693002: Plugin support for protobuf compiler (protoc) targets. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 | « build/protoc.gypi ('k') | tools/protoc_wrapper/protoc_wrapper.py » ('j') | 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 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",
]
« no previous file with comments | « build/protoc.gypi ('k') | tools/protoc_wrapper/protoc_wrapper.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698