Merge "cpp output of an AIDL file is together with the headers" am: 3bc51dfc72
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1666828 Change-Id: I095868153ac8a1bc8f54c800476f95d4b0509063
This commit is contained in:
15
cc/gen.go
15
cc/gen.go
@@ -111,9 +111,7 @@ func genYacc(ctx android.ModuleContext, rule *android.RuleBuilder, yaccFile andr
|
|||||||
return ret
|
return ret
|
||||||
}
|
}
|
||||||
|
|
||||||
func genAidl(ctx android.ModuleContext, rule *android.RuleBuilder, aidlFile android.Path,
|
func genAidl(ctx android.ModuleContext, rule *android.RuleBuilder, aidlFile android.Path, aidlFlags string) (cppFile android.OutputPath, headerFiles android.Paths) {
|
||||||
outFile, depFile android.ModuleGenPath, aidlFlags string) android.Paths {
|
|
||||||
|
|
||||||
aidlPackage := strings.TrimSuffix(aidlFile.Rel(), aidlFile.Base())
|
aidlPackage := strings.TrimSuffix(aidlFile.Rel(), aidlFile.Base())
|
||||||
baseName := strings.TrimSuffix(aidlFile.Base(), aidlFile.Ext())
|
baseName := strings.TrimSuffix(aidlFile.Base(), aidlFile.Ext())
|
||||||
shortName := baseName
|
shortName := baseName
|
||||||
@@ -126,6 +124,8 @@ func genAidl(ctx android.ModuleContext, rule *android.RuleBuilder, aidlFile andr
|
|||||||
}
|
}
|
||||||
|
|
||||||
outDir := android.PathForModuleGen(ctx, "aidl")
|
outDir := android.PathForModuleGen(ctx, "aidl")
|
||||||
|
cppFile = outDir.Join(ctx, aidlPackage, baseName+".cpp")
|
||||||
|
depFile := outDir.Join(ctx, aidlPackage, baseName+".cpp.d")
|
||||||
headerI := outDir.Join(ctx, aidlPackage, baseName+".h")
|
headerI := outDir.Join(ctx, aidlPackage, baseName+".h")
|
||||||
headerBn := outDir.Join(ctx, aidlPackage, "Bn"+shortName+".h")
|
headerBn := outDir.Join(ctx, aidlPackage, "Bn"+shortName+".h")
|
||||||
headerBp := outDir.Join(ctx, aidlPackage, "Bp"+shortName+".h")
|
headerBp := outDir.Join(ctx, aidlPackage, "Bp"+shortName+".h")
|
||||||
@@ -142,14 +142,14 @@ func genAidl(ctx android.ModuleContext, rule *android.RuleBuilder, aidlFile andr
|
|||||||
Flag(aidlFlags).
|
Flag(aidlFlags).
|
||||||
Input(aidlFile).
|
Input(aidlFile).
|
||||||
OutputDir().
|
OutputDir().
|
||||||
Output(outFile).
|
Output(cppFile).
|
||||||
ImplicitOutputs(android.WritablePaths{
|
ImplicitOutputs(android.WritablePaths{
|
||||||
headerI,
|
headerI,
|
||||||
headerBn,
|
headerBn,
|
||||||
headerBp,
|
headerBp,
|
||||||
})
|
})
|
||||||
|
|
||||||
return android.Paths{
|
return cppFile, android.Paths{
|
||||||
headerI,
|
headerI,
|
||||||
headerBn,
|
headerBn,
|
||||||
headerBp,
|
headerBp,
|
||||||
@@ -293,10 +293,9 @@ func genSources(ctx android.ModuleContext, srcFiles android.Paths,
|
|||||||
aidlRule = android.NewRuleBuilder(pctx, ctx).Sbox(android.PathForModuleGen(ctx, "aidl"),
|
aidlRule = android.NewRuleBuilder(pctx, ctx).Sbox(android.PathForModuleGen(ctx, "aidl"),
|
||||||
android.PathForModuleGen(ctx, "aidl.sbox.textproto"))
|
android.PathForModuleGen(ctx, "aidl.sbox.textproto"))
|
||||||
}
|
}
|
||||||
cppFile := android.GenPathWithExt(ctx, "aidl", srcFile, "cpp")
|
cppFile, aidlHeaders := genAidl(ctx, aidlRule, srcFile, buildFlags.aidlFlags)
|
||||||
depFile := android.GenPathWithExt(ctx, "aidl", srcFile, "cpp.d")
|
|
||||||
srcFiles[i] = cppFile
|
srcFiles[i] = cppFile
|
||||||
aidlHeaders := genAidl(ctx, aidlRule, srcFile, cppFile, depFile, buildFlags.aidlFlags)
|
|
||||||
info.aidlHeaders = append(info.aidlHeaders, aidlHeaders...)
|
info.aidlHeaders = append(info.aidlHeaders, aidlHeaders...)
|
||||||
// Use the generated headers as order only deps to ensure that they are up to date when
|
// Use the generated headers as order only deps to ensure that they are up to date when
|
||||||
// needed.
|
// needed.
|
||||||
|
Reference in New Issue
Block a user