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

Unified Diff: third_party/protobuf/proto_library.gni

Issue 2388113003: Allow proto-path in the proto_library target (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 | tools/protoc_wrapper/protoc_wrapper.py » ('j') | tools/protoc_wrapper/protoc_wrapper.py » ('J')
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..9b64ef8de0c06fee4a87c9c95f298f41e0c5975e 100644
--- a/third_party/protobuf/proto_library.gni
+++ b/third_party/protobuf/proto_library.gni
@@ -19,6 +19,10 @@
# 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)
+# Specifies the path of an additionnal directory to find imported
sdefresne 2016/10/04 11:29:55 I would make this an optional list (to allow addin
Olivier 2016/10/04 12:44:31 Done.
+# protos.
+#
# generate_python (optional, default true)
# Generate Python protobuf stubs.
#
@@ -236,6 +240,12 @@ template("proto_library") {
"--proto-in-dir",
rebase_path(proto_in_dir, root_build_dir),
]
+ if (defined(invoker.proto_path)) {
+ args += [
sdefresne 2016/10/04 11:29:55 If using a list as recommended, then you would nee
Olivier 2016/10/04 12:44:31 Done.
+ "--proto-path",
+ "./" + rebase_path(invoker.proto_path, root_build_dir),
sdefresne 2016/10/04 11:29:55 I think you can remove this "./".
Olivier 2016/10/04 12:44:31 Done.
+ ]
+ }
if (generate_cc) {
args += [
@@ -294,8 +304,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"
@@ -317,6 +326,7 @@ template("proto_library") {
forward_variables_from(invoker,
[
"defines",
+ "include_dirs",
"testonly",
"visibility",
])
« no previous file with comments | « no previous file | tools/protoc_wrapper/protoc_wrapper.py » ('j') | tools/protoc_wrapper/protoc_wrapper.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698