diff --git a/third_party/protobuf/BUILD.gn b/third_party/protobuf/BUILD.gn index 8e42cf827..d33c58869 100644 --- a/third_party/protobuf/BUILD.gn +++ b/third_party/protobuf/BUILD.gn @@ -15,6 +15,7 @@ import("//build_overrides/pigweed.gni") import("$dir_pw_build/target_types.gni") +import("$dir_pw_protobuf_compiler/proto.gni") import("protobuf.gni") # This file defines a GN source_set for an external installation of protobuf. @@ -146,6 +147,23 @@ if (dir_pw_third_party_protobuf != "") { public_deps = [ ":libprotobuf_lite" ] configs = [ ":defines" ] } + + pw_proto_library("wellknown_types") { + sources = [ + "$dir_pw_third_party_protobuf/src/google/protobuf/any.proto", + "$dir_pw_third_party_protobuf/src/google/protobuf/api.proto", + "$dir_pw_third_party_protobuf/src/google/protobuf/descriptor.proto", + "$dir_pw_third_party_protobuf/src/google/protobuf/duration.proto", + "$dir_pw_third_party_protobuf/src/google/protobuf/empty.proto", + "$dir_pw_third_party_protobuf/src/google/protobuf/field_mask.proto", + "$dir_pw_third_party_protobuf/src/google/protobuf/source_context.proto", + "$dir_pw_third_party_protobuf/src/google/protobuf/struct.proto", + "$dir_pw_third_party_protobuf/src/google/protobuf/timestamp.proto", + "$dir_pw_third_party_protobuf/src/google/protobuf/type.proto", + "$dir_pw_third_party_protobuf/src/google/protobuf/wrappers.proto", + ] + strip_prefix = "$dir_pw_third_party_protobuf/src/" + } } else { # As mentioned above, these targets are effectively disabled if the build # argument pointing to the protobuf source directory is not set.