[licenses] Add applicable_licenses to proto_library.gni
Change-Id: I038c52930c2227ae1a20205fdd81c85cdf7b8649
diff --git a/proto_library.gni b/proto_library.gni
index ad48971..4cd2114 100644
--- a/proto_library.gni
+++ b/proto_library.gni
@@ -138,7 +138,7 @@
assert(!generate_go || !generate_go_grpc,
"Only one of generate_go or generate_go_grpc can be enabled!")
- not_needed(invoker, ["propagate_imports_configs"])
+ not_needed(invoker, [ "propagate_imports_configs" ])
if (defined(invoker.generator_plugin_label)) {
# Straightforward way to get the name of executable doesn't work because
@@ -218,10 +218,8 @@
assert(!defined(invoker.generate_descriptor))
descriptor_set_path_ = "${target_out_dir}/${target_name}.desc.pb"
} else if (defined(invoker.generate_descriptor)) {
- descriptor_set_path_ =
- "$root_gen_dir/" +
- rebase_path(proto_out_dir, "//") +
- invoker.generate_descriptor
+ descriptor_set_path_ = "$root_gen_dir/" + rebase_path(proto_out_dir, "//") +
+ invoker.generate_descriptor
}
if (descriptor_set_path_ != "") {
protogens += [ descriptor_set_path_ ]
@@ -255,11 +253,12 @@
}
if (descriptor_set_path_ != "") {
# Descriptor-only protobuf targets do not use |proto_path|
- not_needed(["proto_path"])
+ not_needed([ "proto_path" ])
}
}
generated_file("${target_name}_protoc_outputs") {
+ forward_variables_from(invoker, [ "applicable_licenses" ])
contents = rebase_path(protogens, root_build_dir)
outputs = [ "${target_gen_dir}/${target_name}.protoc_output_info" ]
}
@@ -269,6 +268,7 @@
# Generate protobuf stubs.
action(action_name) {
+ forward_variables_from(invoker, [ "applicable_licenses" ])
visibility = []
visibility = [ ":*" ]
script = "//build/secondary/third_party/protobuf/protoc_wrapper.py"
@@ -430,6 +430,7 @@
static_library(_static_lib_name) {
forward_variables_from(invoker,
[
+ "applicable_licenses",
"defines",
"deps",
"testonly",
@@ -471,8 +472,7 @@
# Allows generated protobufs to use #include subpaths rooted from
# |proto_out_dir|.
- include_dirs = [ "${root_gen_dir}/" +
- rebase_path(proto_out_dir, "//") ]
+ include_dirs = [ "${root_gen_dir}/" + rebase_path(proto_out_dir, "//") ]
}
}
}