protozero: Fix GN propagation of public config
The protozero_library template should propagate up a
public_config that adds the protozero/include path
to dependent targets.
Bug: 68749974
Change-Id: Ifd526c400fa58d3e42bb94ba1cef844dbb166674
diff --git a/build/proto_library.gni b/build/proto_library.gni
index 5ecc80c..c13d3f2 100644
--- a/build/proto_library.gni
+++ b/build/proto_library.gni
@@ -144,6 +144,7 @@
[
"defines",
"include_dirs",
+ "public_configs",
"testonly",
"visibility",
])
@@ -155,7 +156,11 @@
configs += invoker.extra_configs
}
- public_configs = [
+ if (!defined(invoker.public_configs)) {
+ public_configs = []
+ }
+
+ public_configs += [
"//buildtools:protobuf_gen_config",
":$config_name",
]
diff --git a/protozero/protozero_library.gni b/protozero/protozero_library.gni
index 324df6e..83818b7 100644
--- a/protozero/protozero_library.gni
+++ b/protozero/protozero_library.gni
@@ -23,6 +23,7 @@
generator_plugin_label = "//protozero/src/protoc_plugin"
generator_plugin_suffix = ".pbzero"
generator_plugin_options = "wrapper_namespace=pbzero"
+ public_configs = [ "//protozero:protozero_config" ]
forward_variables_from(invoker,
[
"defines",