Add support for .proto files
.proto files are translated to .pb.cc and .pb.h files, which are then compiled normally. Bug: 32286026 Test: mmma -j system/extras/perfprofd Change-Id: I538071424d667aacf35b4b8bfebe217f5f092726
This commit is contained in:
@@ -55,6 +55,11 @@ type LibraryProperties struct {
|
||||
// rename host libraries to prevent overlap with system installed libraries
|
||||
Unique_host_soname *bool
|
||||
|
||||
Proto struct {
|
||||
// export headers generated from .proto sources
|
||||
Export_proto_headers bool
|
||||
}
|
||||
|
||||
VariantName string `blueprint:"mutated"`
|
||||
|
||||
// Build a static variant
|
||||
@@ -473,6 +478,16 @@ func (library *libraryDecorator) link(ctx ModuleContext,
|
||||
library.reexportFlags(deps.ReexportedFlags)
|
||||
library.reexportDeps(deps.ReexportedFlagsDeps)
|
||||
|
||||
if library.baseCompiler.hasProto() {
|
||||
if library.Properties.Proto.Export_proto_headers {
|
||||
library.reexportFlags([]string{
|
||||
"-I" + protoSubDir(ctx).String(),
|
||||
"-I" + protoDir(ctx).String(),
|
||||
})
|
||||
library.reexportDeps(library.baseCompiler.deps) // TODO: restrict to proto deps
|
||||
}
|
||||
}
|
||||
|
||||
return out
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user