summaryrefslogtreecommitdiff
path: root/cc/cc.go
diff options
context:
space:
mode:
author Yu Liu <yudiliu@google.com> 2024-12-18 00:35:39 +0000
committer Yu Liu <yudiliu@google.com> 2024-12-18 00:37:10 +0000
commit4f82513b09679c53bfd918318b5ec852f3425ba2 (patch)
treec0a819328926c16b304eb8913b03c3b12be13bb9 /cc/cc.go
parent3ae96651e532564eb5910bb352345df7f081f0fe (diff)
Convert findImplementationLibrary and compilerFlags to use ModuleProxy.
Bug: 377723687 Test: Unit tests and compare the ninja and mk files generated. Change-Id: If1f4a1bf81737c49046cd268a34110a0e38bb2f5
Diffstat (limited to 'cc/cc.go')
-rw-r--r--cc/cc.go38
1 files changed, 20 insertions, 18 deletions
diff --git a/cc/cc.go b/cc/cc.go
index a877f470a..18bffb510 100644
--- a/cc/cc.go
+++ b/cc/cc.go
@@ -46,9 +46,9 @@ type CcMakeVarsInfo struct {
var CcMakeVarsInfoProvider = blueprint.NewProvider[*CcMakeVarsInfo]()
type CcObjectInfo struct {
- objFiles android.Paths
- tidyFiles android.Paths
- kytheFiles android.Paths
+ ObjFiles android.Paths
+ TidyFiles android.Paths
+ KytheFiles android.Paths
}
var CcObjectInfoProvider = blueprint.NewProvider[CcObjectInfo]()
@@ -73,13 +73,14 @@ type CompilerInfo struct {
}
type LinkerInfo struct {
- Whole_static_libs proptools.Configurable[[]string]
+ WholeStaticLibs proptools.Configurable[[]string]
// list of modules that should be statically linked into this module.
- Static_libs proptools.Configurable[[]string]
+ StaticLibs proptools.Configurable[[]string]
// list of modules that should be dynamically linked into this module.
- Shared_libs proptools.Configurable[[]string]
+ SharedLibs proptools.Configurable[[]string]
// list of modules that should only provide headers for this module.
- Header_libs proptools.Configurable[[]string]
+ HeaderLibs proptools.Configurable[[]string]
+ UnstrippedOutputFile android.Path
BinaryDecoratorInfo *BinaryDecoratorInfo
LibraryDecoratorInfo *LibraryDecoratorInfo
@@ -90,7 +91,7 @@ type LinkerInfo struct {
type BinaryDecoratorInfo struct{}
type LibraryDecoratorInfo struct {
- Export_include_dirs proptools.Configurable[[]string]
+ ExportIncludeDirs proptools.Configurable[[]string]
}
type TestBinaryInfo struct {
Gtest bool
@@ -2166,13 +2167,13 @@ func (c *Module) GenerateAndroidBuildActions(actx android.ModuleContext) {
}
ccObjectInfo := CcObjectInfo{
- kytheFiles: objs.kytheFiles,
+ KytheFiles: objs.kytheFiles,
}
if !ctx.Config().KatiEnabled() || !android.ShouldSkipAndroidMkProcessing(ctx, c) {
- ccObjectInfo.objFiles = objs.objFiles
- ccObjectInfo.tidyFiles = objs.tidyFiles
+ ccObjectInfo.ObjFiles = objs.objFiles
+ ccObjectInfo.TidyFiles = objs.tidyFiles
}
- if len(ccObjectInfo.kytheFiles)+len(ccObjectInfo.objFiles)+len(ccObjectInfo.tidyFiles) > 0 {
+ if len(ccObjectInfo.KytheFiles)+len(ccObjectInfo.ObjFiles)+len(ccObjectInfo.TidyFiles) > 0 {
android.SetProvider(ctx, CcObjectInfoProvider, ccObjectInfo)
}
@@ -2199,16 +2200,17 @@ func (c *Module) GenerateAndroidBuildActions(actx android.ModuleContext) {
switch decorator := c.compiler.(type) {
case *libraryDecorator:
ccInfo.CompilerInfo.LibraryDecoratorInfo = &LibraryDecoratorInfo{
- Export_include_dirs: decorator.flagExporter.Properties.Export_include_dirs,
+ ExportIncludeDirs: decorator.flagExporter.Properties.Export_include_dirs,
}
}
}
if c.linker != nil {
ccInfo.LinkerInfo = &LinkerInfo{
- Whole_static_libs: c.linker.baseLinkerProps().Whole_static_libs,
- Static_libs: c.linker.baseLinkerProps().Static_libs,
- Shared_libs: c.linker.baseLinkerProps().Shared_libs,
- Header_libs: c.linker.baseLinkerProps().Header_libs,
+ WholeStaticLibs: c.linker.baseLinkerProps().Whole_static_libs,
+ StaticLibs: c.linker.baseLinkerProps().Static_libs,
+ SharedLibs: c.linker.baseLinkerProps().Shared_libs,
+ HeaderLibs: c.linker.baseLinkerProps().Header_libs,
+ UnstrippedOutputFile: c.UnstrippedOutputFile(),
}
switch decorator := c.linker.(type) {
case *binaryDecorator:
@@ -4080,7 +4082,7 @@ type kytheExtractAllSingleton struct {
func (ks *kytheExtractAllSingleton) GenerateBuildActions(ctx android.SingletonContext) {
var xrefTargets android.Paths
ctx.VisitAllModuleProxies(func(module android.ModuleProxy) {
- files := android.OtherModuleProviderOrDefault(ctx, module, CcObjectInfoProvider).kytheFiles
+ files := android.OtherModuleProviderOrDefault(ctx, module, CcObjectInfoProvider).KytheFiles
if len(files) > 0 {
xrefTargets = append(xrefTargets, files...)
}