aboutsummaryrefslogtreecommitdiffstats
path: root/cc/object.go
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2016-07-29 17:28:03 -0700
committerColin Cross <ccross@android.com>2016-08-05 10:25:09 -0700
commitb916a38233e6862ec74dd840038ae224f6fde1c7 (patch)
treec830af79126bf82b750bad58bd9808a638607da8 /cc/object.go
parent01344df46ee1744dd1ff7815705564deb43ac7cb (diff)
downloadbuild_soong-b916a38233e6862ec74dd840038ae224f6fde1c7.tar.gz
build_soong-b916a38233e6862ec74dd840038ae224f6fde1c7.tar.bz2
build_soong-b916a38233e6862ec74dd840038ae224f6fde1c7.zip
Refactor cc modules to use decorators instead of inheritance
For example , instead of trying to have libraryLinker inherit from baseLinker and libraryCompiler inherit from baseCompiler, create a single decorator object that wraps both baseLinker and baseCompiler. Test: Builds, no unexpected changes to build.ninja Change-Id: I2468adaea8466c203a240259ba5694b8b1df7a52
Diffstat (limited to 'cc/object.go')
-rw-r--r--cc/object.go11
1 files changed, 5 insertions, 6 deletions
diff --git a/cc/object.go b/cc/object.go
index fbb7b7f2..c9f0a060 100644
--- a/cc/object.go
+++ b/cc/object.go
@@ -32,13 +32,16 @@ func init() {
}
type objectLinker struct {
+ *baseLinker
Properties ObjectLinkerProperties
}
func objectFactory() (blueprint.Module, []interface{}) {
module := newBaseModule(android.DeviceSupported, android.MultilibBoth)
- module.compiler = &baseCompiler{}
- module.linker = &objectLinker{}
+ module.linker = &objectLinker{
+ baseLinker: NewBaseLinker(),
+ }
+ module.compiler = NewBaseCompiler()
return module.Init()
}
@@ -84,7 +87,3 @@ func (object *objectLinker) link(ctx ModuleContext,
ctx.CheckbuildFile(outputFile)
return outputFile
}
-
-func (*objectLinker) installable() bool {
- return false
-}