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

Unified Diff: third_party/protobuf/proto_library.gni

Issue 2388113003: Allow proto-path in the proto_library target (Closed)
Patch Set: feedback 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 | 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 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.
« no previous file with comments | « no previous file | tools/protoc_wrapper/protoc_wrapper.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698