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..092ca525d299edb95e8c65b95804ba98febb78c4 100644 |
--- a/third_party/protobuf/proto_library.gni |
+++ b/third_party/protobuf/proto_library.gni |
@@ -19,6 +19,9 @@ |
# This path will be appended to |root_gen_dir|, but for python stubs |
# it will be appended to |root_build_dir|/pyproto. |
# |
+# proto_path (optional) |
+# List of additional directories to find imported protos. |
+# |
# generate_python (optional, default true) |
# Generate Python protobuf stubs. |
# |
@@ -236,6 +239,14 @@ template("proto_library") { |
"--proto-in-dir", |
rebase_path(proto_in_dir, root_build_dir), |
] |
+ if (defined(invoker.proto_path)) { |
+ foreach(_proto_dir, invoker.proto_path) { |
+ args += [ |
+ "--proto-path", |
+ rebase_path(_proto_dir, root_build_dir), |
+ ] |
+ } |
+ } |
if (generate_cc) { |
args += [ |
@@ -294,8 +305,7 @@ template("proto_library") { |
# Option to disable building a library in component build. |
if (defined(invoker.component_build_force_source_set) && |
- invoker.component_build_force_source_set && |
- is_component_build) { |
+ invoker.component_build_force_source_set && is_component_build) { |
link_target_type = "source_set" |
} else { |
link_target_type = "static_library" |
@@ -327,7 +337,13 @@ template("proto_library") { |
configs += invoker.extra_configs |
} |
- public_configs = [ "//third_party/protobuf:using_proto" ] |
+ if (!defined(invoker.public_configs)) { |
sdefresne
2016/10/06 16:44:44
The pattern we usually use is the following:
forw
|
+ public_configs = [] |
+ } else { |
+ public_configs = invoker.public_configs |
+ } |
+ |
+ public_configs += [ "//third_party/protobuf:using_proto" ] |
if (generate_cc || generate_with_plugin) { |
# Not necessary if all protos are located in the same directory. |