cc: unexport Flags and DepNames
Flags and DepNames are no longer needed outside of cc, they are replaced by ModifyProperties. Change-Id: I84ff0dc180cb3459d6181a83fc67c6158987c1ae
This commit is contained in:
parent
fa1387916f
commit
0676e2d1d6
1 changed files with 17 additions and 17 deletions
34
cc/cc.go
34
cc/cc.go
|
@ -113,10 +113,10 @@ type CCModuleType interface {
|
||||||
ModifyProperties(common.AndroidBaseContext)
|
ModifyProperties(common.AndroidBaseContext)
|
||||||
|
|
||||||
// Modify the ccFlags
|
// Modify the ccFlags
|
||||||
Flags(common.AndroidModuleContext, CCFlags) CCFlags
|
flags(common.AndroidModuleContext, CCFlags) CCFlags
|
||||||
|
|
||||||
// Return list of dependency names for use in AndroidDynamicDependencies and in depsToPaths
|
// Return list of dependency names for use in AndroidDynamicDependencies and in depsToPaths
|
||||||
DepNames(common.AndroidBaseContext, CCDeps) CCDeps
|
depNames(common.AndroidBaseContext, CCDeps) CCDeps
|
||||||
|
|
||||||
// Compile objects into final module
|
// Compile objects into final module
|
||||||
compileModule(common.AndroidModuleContext, CCFlags, CCDeps, []string)
|
compileModule(common.AndroidModuleContext, CCFlags, CCDeps, []string)
|
||||||
|
@ -301,7 +301,7 @@ func (c *CCBase) GenerateAndroidBuildActions(ctx common.AndroidModuleContext) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
depNames := c.module.DepNames(ctx, CCDeps{})
|
depNames := c.module.depNames(ctx, CCDeps{})
|
||||||
if ctx.Failed() {
|
if ctx.Failed() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -367,7 +367,7 @@ func (c *CCBase) AndroidDynamicDependencies(ctx common.AndroidDynamicDependerMod
|
||||||
c.module.ModifyProperties(ctx)
|
c.module.ModifyProperties(ctx)
|
||||||
|
|
||||||
depNames := CCDeps{}
|
depNames := CCDeps{}
|
||||||
depNames = c.module.DepNames(ctx, depNames)
|
depNames = c.module.depNames(ctx, depNames)
|
||||||
staticLibs := depNames.WholeStaticLibs
|
staticLibs := depNames.WholeStaticLibs
|
||||||
staticLibs = append(staticLibs, depNames.StaticLibs...)
|
staticLibs = append(staticLibs, depNames.StaticLibs...)
|
||||||
staticLibs = append(staticLibs, depNames.LateStaticLibs...)
|
staticLibs = append(staticLibs, depNames.LateStaticLibs...)
|
||||||
|
@ -512,7 +512,7 @@ func (c *CCBase) collectFlags(ctx common.AndroidModuleContext, toolchain Toolcha
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
flags = c.ccModuleType().Flags(ctx, flags)
|
flags = c.ccModuleType().flags(ctx, flags)
|
||||||
|
|
||||||
// Optimization to reduce size of build.ninja
|
// Optimization to reduce size of build.ninja
|
||||||
// Replace the long list of flags for each file with a module-local variable
|
// Replace the long list of flags for each file with a module-local variable
|
||||||
|
@ -526,7 +526,7 @@ func (c *CCBase) collectFlags(ctx common.AndroidModuleContext, toolchain Toolcha
|
||||||
return flags
|
return flags
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *CCBase) Flags(ctx common.AndroidModuleContext, flags CCFlags) CCFlags {
|
func (c *CCBase) flags(ctx common.AndroidModuleContext, flags CCFlags) CCFlags {
|
||||||
return flags
|
return flags
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -957,7 +957,7 @@ func CCLibraryFactory() (blueprint.Module, []interface{}) {
|
||||||
return NewCCLibrary(module, module, common.HostAndDeviceSupported)
|
return NewCCLibrary(module, module, common.HostAndDeviceSupported)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *CCLibrary) DepNames(ctx common.AndroidBaseContext, depNames CCDeps) CCDeps {
|
func (c *CCLibrary) depNames(ctx common.AndroidBaseContext, depNames CCDeps) CCDeps {
|
||||||
depNames = c.CCLinked.DepNames(ctx, depNames)
|
depNames = c.CCLinked.DepNames(ctx, depNames)
|
||||||
if c.shared() {
|
if c.shared() {
|
||||||
if ctx.Device() {
|
if ctx.Device() {
|
||||||
|
@ -993,7 +993,7 @@ func (c *CCLibrary) exportedFlags() []string {
|
||||||
return c.exportFlags
|
return c.exportFlags
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *CCLibrary) Flags(ctx common.AndroidModuleContext, flags CCFlags) CCFlags {
|
func (c *CCLibrary) flags(ctx common.AndroidModuleContext, flags CCFlags) CCFlags {
|
||||||
flags = c.CCLinked.Flags(ctx, flags)
|
flags = c.CCLinked.Flags(ctx, flags)
|
||||||
|
|
||||||
flags.CFlags = append(flags.CFlags, "-fPIC")
|
flags.CFlags = append(flags.CFlags, "-fPIC")
|
||||||
|
@ -1121,7 +1121,7 @@ func (*ccObject) AndroidDynamicDependencies(ctx common.AndroidDynamicDependerMod
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (*ccObject) DepNames(ctx common.AndroidBaseContext, depNames CCDeps) CCDeps {
|
func (*ccObject) depNames(ctx common.AndroidBaseContext, depNames CCDeps) CCDeps {
|
||||||
// object files can't have any dynamic dependencies
|
// object files can't have any dynamic dependencies
|
||||||
return CCDeps{}
|
return CCDeps{}
|
||||||
}
|
}
|
||||||
|
@ -1191,7 +1191,7 @@ func (c *CCBinary) getStem(ctx common.AndroidModuleContext) string {
|
||||||
return stem + c.BinaryProperties.Suffix
|
return stem + c.BinaryProperties.Suffix
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *CCBinary) DepNames(ctx common.AndroidBaseContext, depNames CCDeps) CCDeps {
|
func (c *CCBinary) depNames(ctx common.AndroidBaseContext, depNames CCDeps) CCDeps {
|
||||||
depNames = c.CCLinked.DepNames(ctx, depNames)
|
depNames = c.CCLinked.DepNames(ctx, depNames)
|
||||||
if ctx.Device() {
|
if ctx.Device() {
|
||||||
if c.BinaryProperties.Static_executable {
|
if c.BinaryProperties.Static_executable {
|
||||||
|
@ -1228,7 +1228,7 @@ func CCBinaryFactory() (blueprint.Module, []interface{}) {
|
||||||
return NewCCBinary(module, module, common.HostAndDeviceSupported)
|
return NewCCBinary(module, module, common.HostAndDeviceSupported)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *CCBinary) Flags(ctx common.AndroidModuleContext, flags CCFlags) CCFlags {
|
func (c *CCBinary) flags(ctx common.AndroidModuleContext, flags CCFlags) CCFlags {
|
||||||
flags = c.CCLinked.Flags(ctx, flags)
|
flags = c.CCLinked.Flags(ctx, flags)
|
||||||
|
|
||||||
flags.CFlags = append(flags.CFlags, "-fpie")
|
flags.CFlags = append(flags.CFlags, "-fpie")
|
||||||
|
@ -1304,8 +1304,8 @@ type ccTest struct {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *ccTest) Flags(ctx common.AndroidModuleContext, flags CCFlags) CCFlags {
|
func (c *ccTest) flags(ctx common.AndroidModuleContext, flags CCFlags) CCFlags {
|
||||||
flags = c.CCBinary.Flags(ctx, flags)
|
flags = c.CCBinary.flags(ctx, flags)
|
||||||
|
|
||||||
flags.CFlags = append(flags.CFlags, "-DGTEST_HAS_STD_STRING")
|
flags.CFlags = append(flags.CFlags, "-DGTEST_HAS_STD_STRING")
|
||||||
if ctx.Host() {
|
if ctx.Host() {
|
||||||
|
@ -1320,8 +1320,8 @@ func (c *ccTest) Flags(ctx common.AndroidModuleContext, flags CCFlags) CCFlags {
|
||||||
return flags
|
return flags
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *ccTest) DepNames(ctx common.AndroidBaseContext, depNames CCDeps) CCDeps {
|
func (c *ccTest) depNames(ctx common.AndroidBaseContext, depNames CCDeps) CCDeps {
|
||||||
depNames = c.CCBinary.DepNames(ctx, depNames)
|
depNames = c.CCBinary.depNames(ctx, depNames)
|
||||||
depNames.StaticLibs = append(depNames.StaticLibs, "libgtest", "libgtest_main")
|
depNames.StaticLibs = append(depNames.StaticLibs, "libgtest", "libgtest_main")
|
||||||
return depNames
|
return depNames
|
||||||
}
|
}
|
||||||
|
@ -1433,7 +1433,7 @@ func (*toolchainLibrary) AndroidDynamicDependencies(ctx common.AndroidDynamicDep
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (*toolchainLibrary) DepNames(ctx common.AndroidBaseContext, depNames CCDeps) CCDeps {
|
func (*toolchainLibrary) depNames(ctx common.AndroidBaseContext, depNames CCDeps) CCDeps {
|
||||||
// toolchain libraries can't have any dependencies
|
// toolchain libraries can't have any dependencies
|
||||||
return CCDeps{}
|
return CCDeps{}
|
||||||
}
|
}
|
||||||
|
@ -1486,7 +1486,7 @@ func (*ndkPrebuiltLibrary) AndroidDynamicDependencies(
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (*ndkPrebuiltLibrary) DepNames(ctx common.AndroidBaseContext, depNames CCDeps) CCDeps {
|
func (*ndkPrebuiltLibrary) depNames(ctx common.AndroidBaseContext, depNames CCDeps) CCDeps {
|
||||||
// NDK libraries can't have any dependencies
|
// NDK libraries can't have any dependencies
|
||||||
return CCDeps{}
|
return CCDeps{}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue