Rename compiler, linker and installer methods to be unique
compiler, linker, and installer interfaces may be implemented by a single decorator object, rename their methods to be unique to avoid the same method being called multiple times. Test: out/soong/build.ninja unchanged Change-Id: I1608c41cd68f614ba99c11bb9fcc7936f618d9aa
This commit is contained in:
16
cc/binary.go
16
cc/binary.go
@@ -67,8 +67,8 @@ type binaryLinker struct {
|
|||||||
|
|
||||||
var _ linker = (*binaryLinker)(nil)
|
var _ linker = (*binaryLinker)(nil)
|
||||||
|
|
||||||
func (binary *binaryLinker) props() []interface{} {
|
func (binary *binaryLinker) linkerProps() []interface{} {
|
||||||
return append(binary.baseLinker.props(),
|
return append(binary.baseLinker.linkerProps(),
|
||||||
&binary.Properties,
|
&binary.Properties,
|
||||||
&binary.stripper.StripProperties)
|
&binary.stripper.StripProperties)
|
||||||
|
|
||||||
@@ -91,8 +91,8 @@ func (binary *binaryLinker) getStem(ctx BaseModuleContext) string {
|
|||||||
return stem + binary.Properties.Suffix
|
return stem + binary.Properties.Suffix
|
||||||
}
|
}
|
||||||
|
|
||||||
func (binary *binaryLinker) deps(ctx BaseModuleContext, deps Deps) Deps {
|
func (binary *binaryLinker) linkerDeps(ctx BaseModuleContext, deps Deps) Deps {
|
||||||
deps = binary.baseLinker.deps(ctx, deps)
|
deps = binary.baseLinker.linkerDeps(ctx, deps)
|
||||||
if ctx.Device() {
|
if ctx.Device() {
|
||||||
if !Bool(binary.baseLinker.Properties.Nocrt) {
|
if !Bool(binary.baseLinker.Properties.Nocrt) {
|
||||||
if !ctx.sdk() {
|
if !ctx.sdk() {
|
||||||
@@ -155,8 +155,8 @@ func NewBinary(hod android.HostOrDeviceSupported) *Module {
|
|||||||
return module
|
return module
|
||||||
}
|
}
|
||||||
|
|
||||||
func (binary *binaryLinker) begin(ctx BaseModuleContext) {
|
func (binary *binaryLinker) linkerInit(ctx BaseModuleContext) {
|
||||||
binary.baseLinker.begin(ctx)
|
binary.baseLinker.linkerInit(ctx)
|
||||||
|
|
||||||
static := Bool(binary.Properties.Static_executable)
|
static := Bool(binary.Properties.Static_executable)
|
||||||
if ctx.Host() {
|
if ctx.Host() {
|
||||||
@@ -175,8 +175,8 @@ func (binary *binaryLinker) begin(ctx BaseModuleContext) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (binary *binaryLinker) flags(ctx ModuleContext, flags Flags) Flags {
|
func (binary *binaryLinker) linkerFlags(ctx ModuleContext, flags Flags) Flags {
|
||||||
flags = binary.baseLinker.flags(ctx, flags)
|
flags = binary.baseLinker.linkerFlags(ctx, flags)
|
||||||
|
|
||||||
if ctx.Host() && !binary.staticBinary() {
|
if ctx.Host() && !binary.staticBinary() {
|
||||||
flags.LdFlags = append(flags.LdFlags, "-pie")
|
flags.LdFlags = append(flags.LdFlags, "-pie")
|
||||||
|
34
cc/cc.go
34
cc/cc.go
@@ -170,21 +170,29 @@ type feature interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type compiler interface {
|
type compiler interface {
|
||||||
feature
|
compilerInit(ctx BaseModuleContext)
|
||||||
|
compilerDeps(ctx BaseModuleContext, deps Deps) Deps
|
||||||
|
compilerFlags(ctx ModuleContext, flags Flags) Flags
|
||||||
|
compilerProps() []interface{}
|
||||||
|
|
||||||
appendCflags([]string)
|
appendCflags([]string)
|
||||||
appendAsflags([]string)
|
appendAsflags([]string)
|
||||||
compile(ctx ModuleContext, flags Flags, deps PathDeps) android.Paths
|
compile(ctx ModuleContext, flags Flags, deps PathDeps) android.Paths
|
||||||
}
|
}
|
||||||
|
|
||||||
type linker interface {
|
type linker interface {
|
||||||
feature
|
linkerInit(ctx BaseModuleContext)
|
||||||
|
linkerDeps(ctx BaseModuleContext, deps Deps) Deps
|
||||||
|
linkerFlags(ctx ModuleContext, flags Flags) Flags
|
||||||
|
linkerProps() []interface{}
|
||||||
|
|
||||||
link(ctx ModuleContext, flags Flags, deps PathDeps, objFiles android.Paths) android.Path
|
link(ctx ModuleContext, flags Flags, deps PathDeps, objFiles android.Paths) android.Path
|
||||||
appendLdflags([]string)
|
appendLdflags([]string)
|
||||||
installable() bool
|
installable() bool
|
||||||
}
|
}
|
||||||
|
|
||||||
type installer interface {
|
type installer interface {
|
||||||
props() []interface{}
|
installerProps() []interface{}
|
||||||
install(ctx ModuleContext, path android.Path)
|
install(ctx ModuleContext, path android.Path)
|
||||||
inData() bool
|
inData() bool
|
||||||
}
|
}
|
||||||
@@ -251,13 +259,13 @@ func (c *Module) Init() (blueprint.Module, []interface{}) {
|
|||||||
props = append(props, c.Customizer.Properties()...)
|
props = append(props, c.Customizer.Properties()...)
|
||||||
}
|
}
|
||||||
if c.compiler != nil {
|
if c.compiler != nil {
|
||||||
props = append(props, c.compiler.props()...)
|
props = append(props, c.compiler.compilerProps()...)
|
||||||
}
|
}
|
||||||
if c.linker != nil {
|
if c.linker != nil {
|
||||||
props = append(props, c.linker.props()...)
|
props = append(props, c.linker.linkerProps()...)
|
||||||
}
|
}
|
||||||
if c.installer != nil {
|
if c.installer != nil {
|
||||||
props = append(props, c.installer.props()...)
|
props = append(props, c.installer.installerProps()...)
|
||||||
}
|
}
|
||||||
if c.stl != nil {
|
if c.stl != nil {
|
||||||
props = append(props, c.stl.props()...)
|
props = append(props, c.stl.props()...)
|
||||||
@@ -391,10 +399,10 @@ func (c *Module) GenerateAndroidBuildActions(actx android.ModuleContext) {
|
|||||||
Clang: c.clang(ctx),
|
Clang: c.clang(ctx),
|
||||||
}
|
}
|
||||||
if c.compiler != nil {
|
if c.compiler != nil {
|
||||||
flags = c.compiler.flags(ctx, flags)
|
flags = c.compiler.compilerFlags(ctx, flags)
|
||||||
}
|
}
|
||||||
if c.linker != nil {
|
if c.linker != nil {
|
||||||
flags = c.linker.flags(ctx, flags)
|
flags = c.linker.linkerFlags(ctx, flags)
|
||||||
}
|
}
|
||||||
if c.stl != nil {
|
if c.stl != nil {
|
||||||
flags = c.stl.flags(ctx, flags)
|
flags = c.stl.flags(ctx, flags)
|
||||||
@@ -462,10 +470,10 @@ func (c *Module) toolchain(ctx BaseModuleContext) config.Toolchain {
|
|||||||
|
|
||||||
func (c *Module) begin(ctx BaseModuleContext) {
|
func (c *Module) begin(ctx BaseModuleContext) {
|
||||||
if c.compiler != nil {
|
if c.compiler != nil {
|
||||||
c.compiler.begin(ctx)
|
c.compiler.compilerInit(ctx)
|
||||||
}
|
}
|
||||||
if c.linker != nil {
|
if c.linker != nil {
|
||||||
c.linker.begin(ctx)
|
c.linker.linkerInit(ctx)
|
||||||
}
|
}
|
||||||
if c.stl != nil {
|
if c.stl != nil {
|
||||||
c.stl.begin(ctx)
|
c.stl.begin(ctx)
|
||||||
@@ -482,10 +490,10 @@ func (c *Module) deps(ctx BaseModuleContext) Deps {
|
|||||||
deps := Deps{}
|
deps := Deps{}
|
||||||
|
|
||||||
if c.compiler != nil {
|
if c.compiler != nil {
|
||||||
deps = c.compiler.deps(ctx, deps)
|
deps = c.compiler.compilerDeps(ctx, deps)
|
||||||
}
|
}
|
||||||
if c.linker != nil {
|
if c.linker != nil {
|
||||||
deps = c.linker.deps(ctx, deps)
|
deps = c.linker.linkerDeps(ctx, deps)
|
||||||
}
|
}
|
||||||
if c.stl != nil {
|
if c.stl != nil {
|
||||||
deps = c.stl.deps(ctx, deps)
|
deps = c.stl.deps(ctx, deps)
|
||||||
@@ -850,7 +858,7 @@ type toolchainLibraryLinker struct {
|
|||||||
|
|
||||||
var _ baseLinkerInterface = (*toolchainLibraryLinker)(nil)
|
var _ baseLinkerInterface = (*toolchainLibraryLinker)(nil)
|
||||||
|
|
||||||
func (*toolchainLibraryLinker) deps(ctx BaseModuleContext, deps Deps) Deps {
|
func (*toolchainLibraryLinker) linkerDeps(ctx BaseModuleContext, deps Deps) Deps {
|
||||||
// toolchain libraries can't have any dependencies
|
// toolchain libraries can't have any dependencies
|
||||||
return deps
|
return deps
|
||||||
}
|
}
|
||||||
|
@@ -103,13 +103,13 @@ func (compiler *baseCompiler) appendAsflags(flags []string) {
|
|||||||
compiler.Properties.Asflags = append(compiler.Properties.Asflags, flags...)
|
compiler.Properties.Asflags = append(compiler.Properties.Asflags, flags...)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (compiler *baseCompiler) props() []interface{} {
|
func (compiler *baseCompiler) compilerProps() []interface{} {
|
||||||
return []interface{}{&compiler.Properties}
|
return []interface{}{&compiler.Properties}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (compiler *baseCompiler) begin(ctx BaseModuleContext) {}
|
func (compiler *baseCompiler) compilerInit(ctx BaseModuleContext) {}
|
||||||
|
|
||||||
func (compiler *baseCompiler) deps(ctx BaseModuleContext, deps Deps) Deps {
|
func (compiler *baseCompiler) compilerDeps(ctx BaseModuleContext, deps Deps) Deps {
|
||||||
deps.GeneratedSources = append(deps.GeneratedSources, compiler.Properties.Generated_sources...)
|
deps.GeneratedSources = append(deps.GeneratedSources, compiler.Properties.Generated_sources...)
|
||||||
deps.GeneratedHeaders = append(deps.GeneratedHeaders, compiler.Properties.Generated_headers...)
|
deps.GeneratedHeaders = append(deps.GeneratedHeaders, compiler.Properties.Generated_headers...)
|
||||||
|
|
||||||
@@ -118,7 +118,7 @@ func (compiler *baseCompiler) deps(ctx BaseModuleContext, deps Deps) Deps {
|
|||||||
|
|
||||||
// Create a Flags struct that collects the compile flags from global values,
|
// Create a Flags struct that collects the compile flags from global values,
|
||||||
// per-target values, module type values, and per-module Blueprints properties
|
// per-target values, module type values, and per-module Blueprints properties
|
||||||
func (compiler *baseCompiler) flags(ctx ModuleContext, flags Flags) Flags {
|
func (compiler *baseCompiler) compilerFlags(ctx ModuleContext, flags Flags) Flags {
|
||||||
tc := ctx.toolchain()
|
tc := ctx.toolchain()
|
||||||
|
|
||||||
CheckBadCompilerFlags(ctx, "cflags", compiler.Properties.Cflags)
|
CheckBadCompilerFlags(ctx, "cflags", compiler.Properties.Cflags)
|
||||||
|
@@ -42,7 +42,7 @@ type baseInstaller struct {
|
|||||||
|
|
||||||
var _ installer = (*baseInstaller)(nil)
|
var _ installer = (*baseInstaller)(nil)
|
||||||
|
|
||||||
func (installer *baseInstaller) props() []interface{} {
|
func (installer *baseInstaller) installerProps() []interface{} {
|
||||||
return []interface{}{&installer.Properties}
|
return []interface{}{&installer.Properties}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -149,13 +149,13 @@ type libraryCompiler struct {
|
|||||||
|
|
||||||
var _ compiler = (*libraryCompiler)(nil)
|
var _ compiler = (*libraryCompiler)(nil)
|
||||||
|
|
||||||
func (library *libraryCompiler) props() []interface{} {
|
func (library *libraryCompiler) compilerProps() []interface{} {
|
||||||
props := library.baseCompiler.props()
|
props := library.baseCompiler.compilerProps()
|
||||||
return append(props, &library.Properties)
|
return append(props, &library.Properties)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (library *libraryCompiler) flags(ctx ModuleContext, flags Flags) Flags {
|
func (library *libraryCompiler) compilerFlags(ctx ModuleContext, flags Flags) Flags {
|
||||||
flags = library.baseCompiler.flags(ctx, flags)
|
flags = library.baseCompiler.compilerFlags(ctx, flags)
|
||||||
|
|
||||||
// MinGW spits out warnings about -fPIC even for -fpie?!) being ignored because
|
// MinGW spits out warnings about -fPIC even for -fpie?!) being ignored because
|
||||||
// all code is position independent, and then those warnings get promoted to
|
// all code is position independent, and then those warnings get promoted to
|
||||||
@@ -227,8 +227,8 @@ type libraryInterface interface {
|
|||||||
objs() android.Paths
|
objs() android.Paths
|
||||||
}
|
}
|
||||||
|
|
||||||
func (library *libraryLinker) props() []interface{} {
|
func (library *libraryLinker) linkerProps() []interface{} {
|
||||||
props := library.baseLinker.props()
|
props := library.baseLinker.linkerProps()
|
||||||
return append(props,
|
return append(props,
|
||||||
&library.Properties,
|
&library.Properties,
|
||||||
&library.dynamicProperties,
|
&library.dynamicProperties,
|
||||||
@@ -251,8 +251,8 @@ func (library *libraryLinker) getLibName(ctx ModuleContext) string {
|
|||||||
return name + library.Properties.VariantName
|
return name + library.Properties.VariantName
|
||||||
}
|
}
|
||||||
|
|
||||||
func (library *libraryLinker) flags(ctx ModuleContext, flags Flags) Flags {
|
func (library *libraryLinker) linkerFlags(ctx ModuleContext, flags Flags) Flags {
|
||||||
flags = library.baseLinker.flags(ctx, flags)
|
flags = library.baseLinker.linkerFlags(ctx, flags)
|
||||||
|
|
||||||
if !library.static() {
|
if !library.static() {
|
||||||
libName := library.getLibName(ctx)
|
libName := library.getLibName(ctx)
|
||||||
@@ -288,8 +288,8 @@ func (library *libraryLinker) flags(ctx ModuleContext, flags Flags) Flags {
|
|||||||
return flags
|
return flags
|
||||||
}
|
}
|
||||||
|
|
||||||
func (library *libraryLinker) deps(ctx BaseModuleContext, deps Deps) Deps {
|
func (library *libraryLinker) linkerDeps(ctx BaseModuleContext, deps Deps) Deps {
|
||||||
deps = library.baseLinker.deps(ctx, deps)
|
deps = library.baseLinker.linkerDeps(ctx, deps)
|
||||||
if library.static() {
|
if library.static() {
|
||||||
deps.WholeStaticLibs = append(deps.WholeStaticLibs, library.Properties.Static.Whole_static_libs...)
|
deps.WholeStaticLibs = append(deps.WholeStaticLibs, library.Properties.Static.Whole_static_libs...)
|
||||||
deps.StaticLibs = append(deps.StaticLibs, library.Properties.Static.Static_libs...)
|
deps.StaticLibs = append(deps.StaticLibs, library.Properties.Static.Static_libs...)
|
||||||
|
@@ -82,7 +82,7 @@ func (linker *baseLinker) appendLdflags(flags []string) {
|
|||||||
linker.Properties.Ldflags = append(linker.Properties.Ldflags, flags...)
|
linker.Properties.Ldflags = append(linker.Properties.Ldflags, flags...)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (linker *baseLinker) begin(ctx BaseModuleContext) {
|
func (linker *baseLinker) linkerInit(ctx BaseModuleContext) {
|
||||||
if ctx.toolchain().Is64Bit() {
|
if ctx.toolchain().Is64Bit() {
|
||||||
linker.dynamicProperties.RunPaths = []string{"../lib64", "lib64"}
|
linker.dynamicProperties.RunPaths = []string{"../lib64", "lib64"}
|
||||||
} else {
|
} else {
|
||||||
@@ -90,11 +90,11 @@ func (linker *baseLinker) begin(ctx BaseModuleContext) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (linker *baseLinker) props() []interface{} {
|
func (linker *baseLinker) linkerProps() []interface{} {
|
||||||
return []interface{}{&linker.Properties, &linker.dynamicProperties}
|
return []interface{}{&linker.Properties, &linker.dynamicProperties}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (linker *baseLinker) deps(ctx BaseModuleContext, deps Deps) Deps {
|
func (linker *baseLinker) linkerDeps(ctx BaseModuleContext, deps Deps) Deps {
|
||||||
deps.WholeStaticLibs = append(deps.WholeStaticLibs, linker.Properties.Whole_static_libs...)
|
deps.WholeStaticLibs = append(deps.WholeStaticLibs, linker.Properties.Whole_static_libs...)
|
||||||
deps.StaticLibs = append(deps.StaticLibs, linker.Properties.Static_libs...)
|
deps.StaticLibs = append(deps.StaticLibs, linker.Properties.Static_libs...)
|
||||||
deps.SharedLibs = append(deps.SharedLibs, linker.Properties.Shared_libs...)
|
deps.SharedLibs = append(deps.SharedLibs, linker.Properties.Shared_libs...)
|
||||||
@@ -133,7 +133,7 @@ func (linker *baseLinker) deps(ctx BaseModuleContext, deps Deps) Deps {
|
|||||||
return deps
|
return deps
|
||||||
}
|
}
|
||||||
|
|
||||||
func (linker *baseLinker) flags(ctx ModuleContext, flags Flags) Flags {
|
func (linker *baseLinker) linkerFlags(ctx ModuleContext, flags Flags) Flags {
|
||||||
toolchain := ctx.toolchain()
|
toolchain := ctx.toolchain()
|
||||||
|
|
||||||
flags.Nocrt = Bool(linker.Properties.Nocrt)
|
flags.Nocrt = Bool(linker.Properties.Nocrt)
|
||||||
|
@@ -211,14 +211,14 @@ type stubLinker struct {
|
|||||||
libraryLinker
|
libraryLinker
|
||||||
}
|
}
|
||||||
|
|
||||||
func (linker *stubLinker) deps(ctx BaseModuleContext, deps Deps) Deps {
|
func (linker *stubLinker) linkerDeps(ctx BaseModuleContext, deps Deps) Deps {
|
||||||
return Deps{}
|
return Deps{}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (linker *stubLinker) flags(ctx ModuleContext, flags Flags) Flags {
|
func (linker *stubLinker) linkerFlags(ctx ModuleContext, flags Flags) Flags {
|
||||||
linker.libraryLinker.libName = strings.TrimSuffix(ctx.ModuleName(),
|
linker.libraryLinker.libName = strings.TrimSuffix(ctx.ModuleName(),
|
||||||
ndkLibrarySuffix)
|
ndkLibrarySuffix)
|
||||||
return linker.libraryLinker.flags(ctx, flags)
|
return linker.libraryLinker.linkerFlags(ctx, flags)
|
||||||
}
|
}
|
||||||
|
|
||||||
type stubInstaller struct {
|
type stubInstaller struct {
|
||||||
|
@@ -63,7 +63,7 @@ type ndkPrebuiltObjectLinker struct {
|
|||||||
objectLinker
|
objectLinker
|
||||||
}
|
}
|
||||||
|
|
||||||
func (*ndkPrebuiltObjectLinker) deps(ctx BaseModuleContext, deps Deps) Deps {
|
func (*ndkPrebuiltObjectLinker) linkerDeps(ctx BaseModuleContext, deps Deps) Deps {
|
||||||
// NDK objects can't have any dependencies
|
// NDK objects can't have any dependencies
|
||||||
return deps
|
return deps
|
||||||
}
|
}
|
||||||
@@ -92,11 +92,11 @@ type ndkPrebuiltLibraryLinker struct {
|
|||||||
var _ baseLinkerInterface = (*ndkPrebuiltLibraryLinker)(nil)
|
var _ baseLinkerInterface = (*ndkPrebuiltLibraryLinker)(nil)
|
||||||
var _ exportedFlagsProducer = (*libraryLinker)(nil)
|
var _ exportedFlagsProducer = (*libraryLinker)(nil)
|
||||||
|
|
||||||
func (ndk *ndkPrebuiltLibraryLinker) props() []interface{} {
|
func (ndk *ndkPrebuiltLibraryLinker) linkerProps() []interface{} {
|
||||||
return append(ndk.libraryLinker.props(), &ndk.Properties, &ndk.flagExporter.Properties)
|
return append(ndk.libraryLinker.linkerProps(), &ndk.Properties, &ndk.flagExporter.Properties)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (*ndkPrebuiltLibraryLinker) deps(ctx BaseModuleContext, deps Deps) Deps {
|
func (*ndkPrebuiltLibraryLinker) linkerDeps(ctx BaseModuleContext, deps Deps) Deps {
|
||||||
// NDK libraries can't have any dependencies
|
// NDK libraries can't have any dependencies
|
||||||
return deps
|
return deps
|
||||||
}
|
}
|
||||||
|
@@ -46,18 +46,18 @@ func (object *objectLinker) appendLdflags(flags []string) {
|
|||||||
panic(fmt.Errorf("appendLdflags on object Linker not supported"))
|
panic(fmt.Errorf("appendLdflags on object Linker not supported"))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (object *objectLinker) props() []interface{} {
|
func (object *objectLinker) linkerProps() []interface{} {
|
||||||
return []interface{}{&object.Properties}
|
return []interface{}{&object.Properties}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (*objectLinker) begin(ctx BaseModuleContext) {}
|
func (*objectLinker) linkerInit(ctx BaseModuleContext) {}
|
||||||
|
|
||||||
func (object *objectLinker) deps(ctx BaseModuleContext, deps Deps) Deps {
|
func (object *objectLinker) linkerDeps(ctx BaseModuleContext, deps Deps) Deps {
|
||||||
deps.ObjFiles = append(deps.ObjFiles, object.Properties.Objs...)
|
deps.ObjFiles = append(deps.ObjFiles, object.Properties.Objs...)
|
||||||
return deps
|
return deps
|
||||||
}
|
}
|
||||||
|
|
||||||
func (*objectLinker) flags(ctx ModuleContext, flags Flags) Flags {
|
func (*objectLinker) linkerFlags(ctx ModuleContext, flags Flags) Flags {
|
||||||
if flags.Clang {
|
if flags.Clang {
|
||||||
flags.LdFlags = append(flags.LdFlags, ctx.toolchain().ToolchainClangLdflags())
|
flags.LdFlags = append(flags.LdFlags, ctx.toolchain().ToolchainClangLdflags())
|
||||||
} else {
|
} else {
|
||||||
|
44
cc/test.go
44
cc/test.go
@@ -93,7 +93,7 @@ type testLinker struct {
|
|||||||
Properties TestLinkerProperties
|
Properties TestLinkerProperties
|
||||||
}
|
}
|
||||||
|
|
||||||
func (test *testLinker) flags(ctx ModuleContext, flags Flags) Flags {
|
func (test *testLinker) linkerFlags(ctx ModuleContext, flags Flags) Flags {
|
||||||
if !test.Properties.Gtest {
|
if !test.Properties.Gtest {
|
||||||
return flags
|
return flags
|
||||||
}
|
}
|
||||||
@@ -119,7 +119,7 @@ func (test *testLinker) flags(ctx ModuleContext, flags Flags) Flags {
|
|||||||
return flags
|
return flags
|
||||||
}
|
}
|
||||||
|
|
||||||
func (test *testLinker) deps(ctx BaseModuleContext, deps Deps) Deps {
|
func (test *testLinker) linkerDeps(ctx BaseModuleContext, deps Deps) Deps {
|
||||||
if test.Properties.Gtest {
|
if test.Properties.Gtest {
|
||||||
if ctx.sdk() && ctx.Device() {
|
if ctx.sdk() && ctx.Device() {
|
||||||
switch ctx.selectedStl() {
|
switch ctx.selectedStl() {
|
||||||
@@ -142,8 +142,8 @@ type testBinaryLinker struct {
|
|||||||
binaryLinker
|
binaryLinker
|
||||||
}
|
}
|
||||||
|
|
||||||
func (test *testBinaryLinker) begin(ctx BaseModuleContext) {
|
func (test *testBinaryLinker) linkerInit(ctx BaseModuleContext) {
|
||||||
test.binaryLinker.begin(ctx)
|
test.binaryLinker.linkerInit(ctx)
|
||||||
runpath := "../../lib"
|
runpath := "../../lib"
|
||||||
if ctx.toolchain().Is64Bit() {
|
if ctx.toolchain().Is64Bit() {
|
||||||
runpath += "64"
|
runpath += "64"
|
||||||
@@ -151,19 +151,19 @@ func (test *testBinaryLinker) begin(ctx BaseModuleContext) {
|
|||||||
test.dynamicProperties.RunPaths = append([]string{runpath}, test.dynamicProperties.RunPaths...)
|
test.dynamicProperties.RunPaths = append([]string{runpath}, test.dynamicProperties.RunPaths...)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (test *testBinaryLinker) props() []interface{} {
|
func (test *testBinaryLinker) linkerProps() []interface{} {
|
||||||
return append(test.binaryLinker.props(), &test.testLinker.Properties)
|
return append(test.binaryLinker.linkerProps(), &test.testLinker.Properties)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (test *testBinaryLinker) flags(ctx ModuleContext, flags Flags) Flags {
|
func (test *testBinaryLinker) linkerFlags(ctx ModuleContext, flags Flags) Flags {
|
||||||
flags = test.binaryLinker.flags(ctx, flags)
|
flags = test.binaryLinker.linkerFlags(ctx, flags)
|
||||||
flags = test.testLinker.flags(ctx, flags)
|
flags = test.testLinker.linkerFlags(ctx, flags)
|
||||||
return flags
|
return flags
|
||||||
}
|
}
|
||||||
|
|
||||||
func (test *testBinaryLinker) deps(ctx BaseModuleContext, deps Deps) Deps {
|
func (test *testBinaryLinker) linkerDeps(ctx BaseModuleContext, deps Deps) Deps {
|
||||||
deps = test.testLinker.deps(ctx, deps)
|
deps = test.testLinker.linkerDeps(ctx, deps)
|
||||||
deps = test.binaryLinker.deps(ctx, deps)
|
deps = test.binaryLinker.linkerDeps(ctx, deps)
|
||||||
return deps
|
return deps
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -172,19 +172,19 @@ type testLibraryLinker struct {
|
|||||||
*libraryLinker
|
*libraryLinker
|
||||||
}
|
}
|
||||||
|
|
||||||
func (test *testLibraryLinker) props() []interface{} {
|
func (test *testLibraryLinker) linkerProps() []interface{} {
|
||||||
return append(test.libraryLinker.props(), &test.testLinker.Properties)
|
return append(test.libraryLinker.linkerProps(), &test.testLinker.Properties)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (test *testLibraryLinker) flags(ctx ModuleContext, flags Flags) Flags {
|
func (test *testLibraryLinker) linkerFlags(ctx ModuleContext, flags Flags) Flags {
|
||||||
flags = test.libraryLinker.flags(ctx, flags)
|
flags = test.libraryLinker.linkerFlags(ctx, flags)
|
||||||
flags = test.testLinker.flags(ctx, flags)
|
flags = test.testLinker.linkerFlags(ctx, flags)
|
||||||
return flags
|
return flags
|
||||||
}
|
}
|
||||||
|
|
||||||
func (test *testLibraryLinker) deps(ctx BaseModuleContext, deps Deps) Deps {
|
func (test *testLibraryLinker) linkerDeps(ctx BaseModuleContext, deps Deps) Deps {
|
||||||
deps = test.testLinker.deps(ctx, deps)
|
deps = test.testLinker.linkerDeps(ctx, deps)
|
||||||
deps = test.libraryLinker.deps(ctx, deps)
|
deps = test.libraryLinker.linkerDeps(ctx, deps)
|
||||||
return deps
|
return deps
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -235,8 +235,8 @@ type benchmarkLinker struct {
|
|||||||
testBinaryLinker
|
testBinaryLinker
|
||||||
}
|
}
|
||||||
|
|
||||||
func (benchmark *benchmarkLinker) deps(ctx BaseModuleContext, deps Deps) Deps {
|
func (benchmark *benchmarkLinker) linkerDeps(ctx BaseModuleContext, deps Deps) Deps {
|
||||||
deps = benchmark.testBinaryLinker.deps(ctx, deps)
|
deps = benchmark.testBinaryLinker.linkerDeps(ctx, deps)
|
||||||
deps.StaticLibs = append(deps.StaticLibs, "libgoogle-benchmark")
|
deps.StaticLibs = append(deps.StaticLibs, "libgoogle-benchmark")
|
||||||
return deps
|
return deps
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user