diff options
Diffstat (limited to 'third_party/protobuf/proto_library.gni')
-rw-r--r-- | third_party/protobuf/proto_library.gni | 33 |
1 files changed, 23 insertions, 10 deletions
diff --git a/third_party/protobuf/proto_library.gni b/third_party/protobuf/proto_library.gni index 40fb80f..7bbf56d 100644 --- a/third_party/protobuf/proto_library.gni +++ b/third_party/protobuf/proto_library.gni @@ -84,25 +84,34 @@ template("proto_library") { args = [] if (defined(invoker.cc_include)) { - args += [ "--include", invoker.cc_include ] + args += [ + "--include", + invoker.cc_include, + ] } args += [ - "--protobuf", "$rel_out_dir/{{source_name_part}}.pb.h", - "--proto-in-dir", "{{source_dir}}", - "--proto-in-file", "{{source_file_part}}", + "--protobuf", + "$rel_out_dir/{{source_name_part}}.pb.h", + "--proto-in-dir", + "{{source_dir}}", + "--proto-in-file", + "{{source_file_part}}", + # TODO(brettw) support system protobuf compiler. "--use-system-protobuf=0", ] protoc_label = "//third_party/protobuf:protoc($host_toolchain)" args += [ - "--", + "--", + # Prepend with "./" so this will never pick up the system one (normally # when not cross-compiling, protoc's output directory will be the same # as the build dir, so the relative location will be empty). - "./" + rebase_path(get_label_info(protoc_label, "root_out_dir") + - "/protoc", root_build_dir), + "./" + + rebase_path(get_label_info(protoc_label, "root_out_dir") + "/protoc", + root_build_dir), ] # If passed cc_generator_options should end in a colon, which will separate @@ -115,11 +124,15 @@ template("proto_library") { } args += [ # cc_generator_options is supposed to end in a colon if it's nonempty. - "--cpp_out", "$cc_generator_options$rel_out_dir", - "--python_out", rel_out_dir, + "--cpp_out", + "$cc_generator_options$rel_out_dir", + "--python_out", + rel_out_dir, ] - deps = [ protoc_label ] + deps = [ + protoc_label, + ] if (defined(invoker.deps)) { deps += invoker.deps |