Make proto_to_cpp a build-time generator

This CL moves the generation of core classes derived from
protos (TraceConfig, DataSourceConfig, etc) at build time.
Previously these classes were checked in. This was not ideal
and required to re-generate them when changing protos.
The removal of generated classes is done in a separate CL
(aosp/1106801).

Bug: 132880619
Change-Id: I63a162c4bd2f7f8c9afcf843cf574fa8a6805805
diff --git a/src/protozero/protoc_plugin/BUILD.gn b/src/protozero/protoc_plugin/BUILD.gn
index 432abd8..ab8f9a7 100644
--- a/src/protozero/protoc_plugin/BUILD.gn
+++ b/src/protozero/protoc_plugin/BUILD.gn
@@ -14,6 +14,8 @@
 
 import("../../../gn/perfetto_host_executable.gni")
 
+# The plugin that generates zero-copy serializers and deserializers. Those are
+# the xxx.pbzero.h headers used all over the codebase.
 perfetto_host_executable("protozero_plugin") {
   sources = [
     "protozero_plugin.cc",
@@ -24,3 +26,17 @@
     "../../../src/base",
   ]
 }
+
+# The plugin that generates standalone C++ objects from protos (xxx.gen.h).
+# This is used for core classes traced needs to know about such as
+# DataSourceDescriptor.
+perfetto_host_executable("cpp_obj_plugin") {
+  sources = [
+    "cpp_obj_plugin.cc",
+  ]
+  deps = [
+    "../../../gn:default_deps",
+    "../../../gn:protoc_lib",
+    "../../../src/base",
+  ]
+}