Add cc_benchmark module type
Change-Id: I83bed375fa77518baaab4260e714a9368761f0bc
This commit is contained in:
39
cc/cc.go
39
cc/cc.go
@@ -1481,6 +1481,36 @@ func TestPerSrcMutator(mctx blueprint.EarlyMutatorContext) {
|
||||
}
|
||||
}
|
||||
|
||||
type CCBenchmark struct {
|
||||
CCBinary
|
||||
}
|
||||
|
||||
func (c *CCBenchmark) depNames(ctx common.AndroidBaseContext, depNames CCDeps) CCDeps {
|
||||
depNames = c.CCBinary.depNames(ctx, depNames)
|
||||
depNames.StaticLibs = append(depNames.StaticLibs, "libbenchmark")
|
||||
return depNames
|
||||
}
|
||||
|
||||
func (c *CCBenchmark) installModule(ctx common.AndroidModuleContext, flags CCFlags) {
|
||||
if ctx.Device() {
|
||||
ctx.InstallFile("../data/nativetest"+ctx.Arch().ArchType.Multilib[3:]+"/"+ctx.ModuleName(), c.out)
|
||||
} else {
|
||||
c.CCBinary.installModule(ctx, flags)
|
||||
}
|
||||
}
|
||||
|
||||
func NewCCBenchmark(test *CCBenchmark, module CCModuleType,
|
||||
hod common.HostOrDeviceSupported, props ...interface{}) (blueprint.Module, []interface{}) {
|
||||
|
||||
return NewCCBinary(&test.CCBinary, module, hod, props...)
|
||||
}
|
||||
|
||||
func CCBenchmarkFactory() (blueprint.Module, []interface{}) {
|
||||
module := &CCBenchmark{}
|
||||
|
||||
return NewCCBenchmark(module, module, common.HostAndDeviceSupported)
|
||||
}
|
||||
|
||||
//
|
||||
// Static library
|
||||
//
|
||||
@@ -1545,6 +1575,15 @@ func CCTestHostFactory() (blueprint.Module, []interface{}) {
|
||||
&module.TestProperties)
|
||||
}
|
||||
|
||||
//
|
||||
// Host Benchmarks
|
||||
//
|
||||
|
||||
func CCBenchmarkHostFactory() (blueprint.Module, []interface{}) {
|
||||
module := &CCBenchmark{}
|
||||
return NewCCBinary(&module.CCBinary, module, common.HostSupported)
|
||||
}
|
||||
|
||||
//
|
||||
// Device libraries shipped with gcc
|
||||
//
|
||||
|
Reference in New Issue
Block a user