diff options
-rw-r--r-- | cc/binary.go | 2 | ||||
-rw-r--r-- | cc/cc.go | 22 | ||||
-rw-r--r-- | cc/compiler.go | 2 | ||||
-rw-r--r-- | cc/library.go | 2 | ||||
-rw-r--r-- | cc/ndk_library.go | 2 | ||||
-rw-r--r-- | cc/ndk_prebuilt.go | 4 | ||||
-rw-r--r-- | cc/object.go | 2 | ||||
-rw-r--r-- | cc/test.go | 6 | ||||
-rw-r--r-- | cc/tidy.go | 2 | ||||
-rw-r--r-- | cc/toolchain_library.go | 2 |
10 files changed, 28 insertions, 18 deletions
diff --git a/cc/binary.go b/cc/binary.go index 7755b5ff..78883fae 100644 --- a/cc/binary.go +++ b/cc/binary.go @@ -96,7 +96,7 @@ func (binary *binaryDecorator) getStem(ctx BaseModuleContext) string { return stem + binary.Properties.Suffix } -func (binary *binaryDecorator) linkerDeps(ctx BaseModuleContext, deps Deps) Deps { +func (binary *binaryDecorator) linkerDeps(ctx DepsContext, deps Deps) Deps { deps = binary.baseLinker.linkerDeps(ctx, deps) if ctx.toolchain().Bionic() { if !Bool(binary.baseLinker.Properties.Nocrt) { @@ -171,16 +171,21 @@ type BaseModuleContext interface { ModuleContextIntf } +type DepsContext interface { + android.BottomUpMutatorContext + ModuleContextIntf +} + type feature interface { begin(ctx BaseModuleContext) - deps(ctx BaseModuleContext, deps Deps) Deps + deps(ctx DepsContext, deps Deps) Deps flags(ctx ModuleContext, flags Flags) Flags props() []interface{} } type compiler interface { compilerInit(ctx BaseModuleContext) - compilerDeps(ctx BaseModuleContext, deps Deps) Deps + compilerDeps(ctx DepsContext, deps Deps) Deps compilerFlags(ctx ModuleContext, flags Flags) Flags compilerProps() []interface{} @@ -191,7 +196,7 @@ type compiler interface { type linker interface { linkerInit(ctx BaseModuleContext) - linkerDeps(ctx BaseModuleContext, deps Deps) Deps + linkerDeps(ctx DepsContext, deps Deps) Deps linkerFlags(ctx ModuleContext, flags Flags) Flags linkerProps() []interface{} @@ -307,6 +312,11 @@ type baseModuleContext struct { moduleContextImpl } +type depsContext struct { + android.BottomUpMutatorContext + moduleContextImpl +} + type moduleContext struct { android.ModuleContext moduleContextImpl @@ -534,7 +544,7 @@ func (c *Module) begin(ctx BaseModuleContext) { } } -func (c *Module) deps(ctx BaseModuleContext) Deps { +func (c *Module) deps(ctx DepsContext) Deps { deps := Deps{} if c.compiler != nil { @@ -604,8 +614,8 @@ func (c *Module) DepsMutator(actx android.BottomUpMutatorContext) { return } - ctx := &baseModuleContext{ - BaseContext: actx, + ctx := &depsContext{ + BottomUpMutatorContext: actx, moduleContextImpl: moduleContextImpl{ mod: c, }, diff --git a/cc/compiler.go b/cc/compiler.go index 99f56b7b..e6f432c6 100644 --- a/cc/compiler.go +++ b/cc/compiler.go @@ -129,7 +129,7 @@ func (compiler *baseCompiler) compilerProps() []interface{} { func (compiler *baseCompiler) compilerInit(ctx BaseModuleContext) {} -func (compiler *baseCompiler) compilerDeps(ctx BaseModuleContext, deps Deps) Deps { +func (compiler *baseCompiler) compilerDeps(ctx DepsContext, deps Deps) Deps { deps.GeneratedSources = append(deps.GeneratedSources, compiler.Properties.Generated_sources...) deps.GeneratedHeaders = append(deps.GeneratedHeaders, compiler.Properties.Generated_headers...) diff --git a/cc/library.go b/cc/library.go index 666c47ab..8474f969 100644 --- a/cc/library.go +++ b/cc/library.go @@ -351,7 +351,7 @@ func (library *libraryDecorator) linkerInit(ctx BaseModuleContext) { library.relocationPacker.packingInit(ctx) } -func (library *libraryDecorator) linkerDeps(ctx BaseModuleContext, deps Deps) Deps { +func (library *libraryDecorator) linkerDeps(ctx DepsContext, deps Deps) Deps { deps = library.baseLinker.linkerDeps(ctx, deps) if library.static() { diff --git a/cc/ndk_library.go b/cc/ndk_library.go index 0e427313..afa7927e 100644 --- a/cc/ndk_library.go +++ b/cc/ndk_library.go @@ -242,7 +242,7 @@ func (c *stubDecorator) compile(ctx ModuleContext, flags Flags, deps PathDeps) O return compileObjs(ctx, flagsToBuilderFlags(flags), subdir, srcs, nil) } -func (linker *stubDecorator) linkerDeps(ctx BaseModuleContext, deps Deps) Deps { +func (linker *stubDecorator) linkerDeps(ctx DepsContext, deps Deps) Deps { return Deps{} } diff --git a/cc/ndk_prebuilt.go b/cc/ndk_prebuilt.go index 63f89210..676d63d0 100644 --- a/cc/ndk_prebuilt.go +++ b/cc/ndk_prebuilt.go @@ -62,7 +62,7 @@ type ndkPrebuiltObjectLinker struct { objectLinker } -func (*ndkPrebuiltObjectLinker) linkerDeps(ctx BaseModuleContext, deps Deps) Deps { +func (*ndkPrebuiltObjectLinker) linkerDeps(ctx DepsContext, deps Deps) Deps { // NDK objects can't have any dependencies return deps } @@ -96,7 +96,7 @@ func (ndk *ndkPrebuiltLibraryLinker) linkerProps() []interface{} { return append(ndk.libraryDecorator.linkerProps(), &ndk.Properties, &ndk.flagExporter.Properties) } -func (*ndkPrebuiltLibraryLinker) linkerDeps(ctx BaseModuleContext, deps Deps) Deps { +func (*ndkPrebuiltLibraryLinker) linkerDeps(ctx DepsContext, deps Deps) Deps { // NDK libraries can't have any dependencies return deps } diff --git a/cc/object.go b/cc/object.go index 16ed4551..eaddd890 100644 --- a/cc/object.go +++ b/cc/object.go @@ -54,7 +54,7 @@ func (object *objectLinker) linkerProps() []interface{} { func (*objectLinker) linkerInit(ctx BaseModuleContext) {} -func (object *objectLinker) linkerDeps(ctx BaseModuleContext, deps Deps) Deps { +func (object *objectLinker) linkerDeps(ctx DepsContext, deps Deps) Deps { deps.ObjFiles = append(deps.ObjFiles, object.Properties.Objs...) return deps } @@ -199,7 +199,7 @@ func (test *testBinary) linkerInit(ctx BaseModuleContext) { test.binaryDecorator.linkerInit(ctx) } -func (test *testBinary) linkerDeps(ctx BaseModuleContext, deps Deps) Deps { +func (test *testBinary) linkerDeps(ctx DepsContext, deps Deps) Deps { deps = test.testDecorator.linkerDeps(ctx, deps) deps = test.binaryDecorator.linkerDeps(ctx, deps) return deps @@ -250,7 +250,7 @@ func (test *testLibrary) linkerInit(ctx BaseModuleContext) { test.libraryDecorator.linkerInit(ctx) } -func (test *testLibrary) linkerDeps(ctx BaseModuleContext, deps Deps) Deps { +func (test *testLibrary) linkerDeps(ctx DepsContext, deps Deps) Deps { deps = test.testDecorator.linkerDeps(ctx, deps) deps = test.libraryDecorator.linkerDeps(ctx, deps) return deps @@ -288,7 +288,7 @@ func (benchmark *benchmarkDecorator) linkerInit(ctx BaseModuleContext) { benchmark.binaryDecorator.linkerInit(ctx) } -func (benchmark *benchmarkDecorator) linkerDeps(ctx BaseModuleContext, deps Deps) Deps { +func (benchmark *benchmarkDecorator) linkerDeps(ctx DepsContext, deps Deps) Deps { deps = benchmark.binaryDecorator.linkerDeps(ctx, deps) deps.StaticLibs = append(deps.StaticLibs, "libgoogle-benchmark") return deps @@ -44,7 +44,7 @@ func (tidy *tidyFeature) props() []interface{} { func (tidy *tidyFeature) begin(ctx BaseModuleContext) { } -func (tidy *tidyFeature) deps(ctx BaseModuleContext, deps Deps) Deps { +func (tidy *tidyFeature) deps(ctx DepsContext, deps Deps) Deps { return deps } diff --git a/cc/toolchain_library.go b/cc/toolchain_library.go index 6ca9dc33..1bbe7746 100644 --- a/cc/toolchain_library.go +++ b/cc/toolchain_library.go @@ -33,7 +33,7 @@ type toolchainLibraryDecorator struct { *libraryDecorator } -func (*toolchainLibraryDecorator) linkerDeps(ctx BaseModuleContext, deps Deps) Deps { +func (*toolchainLibraryDecorator) linkerDeps(ctx DepsContext, deps Deps) Deps { // toolchain libraries can't have any dependencies return deps } |