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

Unified Diff: third_party/protobuf/proto_library.gni

Issue 1227393002: Add data files for base and net. Move GN Python proto outputs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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 | « third_party/protobuf/BUILD.gn ('k') | third_party/pyftpdlib/BUILD.gn » ('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 b68af85378b674620cc4e9549610f6f2f59b55b4..dfa1df283e9ffe0c07ee7dbccfb7dc4f77ccd1e6 100644
--- a/third_party/protobuf/proto_library.gni
+++ b/third_party/protobuf/proto_library.gni
@@ -74,16 +74,20 @@ template("proto_library") {
# Put the results in the specified dir in the gen tree.
out_dir = "$root_gen_dir/" + invoker.proto_out_dir
rel_out_dir = rebase_path(out_dir, root_build_dir)
+ py_out_dir = "$root_out_dir/pyproto/" + invoker.proto_out_dir
} else {
- # Use the gen directory corresponding to the source file. This expansion
- # will be done differently in the outputs and the args, so we don't need
- # to worry about rebasing as above.
+ # Use the gen directory corresponding to the source file for C++ sources.
+ # This expansion will be done differently in the outputs and the args, so
+ # we don't need to worry about rebasing as above. Always put Python
+ # sources in "pyproto".
out_dir = "{{source_gen_dir}}"
rel_out_dir = "{{source_gen_dir}}"
+ py_out_dir = "$root_out_dir/pyproto/{{source_root_relative_dir}}"
}
+ rel_py_out_dir = rebase_path(py_out_dir, root_build_dir)
outputs = [
- "$out_dir/{{source_name_part}}_pb2.py",
+ "$py_out_dir/{{source_name_part}}_pb2.py",
"$out_dir/{{source_name_part}}.pb.cc",
"$out_dir/{{source_name_part}}.pb.h",
]
@@ -133,7 +137,7 @@ template("proto_library") {
"--cpp_out",
"$cc_generator_options$rel_out_dir",
"--python_out",
- rel_out_dir,
+ rel_py_out_dir,
]
deps = [
« no previous file with comments | « third_party/protobuf/BUILD.gn ('k') | third_party/pyftpdlib/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698