Support aidl cpp generation
Ideally we'd calculate the headers that are written here too, but I'll
add that in a later change that actually enforces the generated header
list.
Test: mmma -j system/tools/aidl
Change-Id: Ifd2e8e8ff444b0f67270fb5156e7bf7bceddb6be
diff --git a/cc/library.go b/cc/library.go
index 7b7ac95..bdd8e79 100644
--- a/cc/library.go
+++ b/cc/library.go
@@ -55,6 +55,11 @@
// rename host libraries to prevent overlap with system installed libraries
Unique_host_soname *bool
+ Aidl struct {
+ // export headers generated from .aidl sources
+ Export_aidl_headers bool
+ }
+
Proto struct {
// export headers generated from .proto sources
Export_proto_headers bool
@@ -495,8 +500,17 @@
library.reexportFlags(deps.ReexportedFlags)
library.reexportDeps(deps.ReexportedFlagsDeps)
- if library.baseCompiler.hasSrcExt(".proto") {
- if library.Properties.Proto.Export_proto_headers {
+ if library.Properties.Aidl.Export_aidl_headers {
+ if library.baseCompiler.hasSrcExt(".aidl") {
+ library.reexportFlags([]string{
+ "-I" + android.PathForModuleGen(ctx, "aidl").String(),
+ })
+ library.reexportDeps(library.baseCompiler.deps) // TODO: restrict to aidl deps
+ }
+ }
+
+ if library.Properties.Proto.Export_proto_headers {
+ if library.baseCompiler.hasSrcExt(".proto") {
library.reexportFlags([]string{
"-I" + protoSubDir(ctx).String(),
"-I" + protoDir(ctx).String(),