diff options
author | Colin Cross <ccross@android.com> | 2016-07-29 17:28:03 -0700 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2016-08-05 10:25:09 -0700 |
commit | b916a38233e6862ec74dd840038ae224f6fde1c7 (patch) | |
tree | c830af79126bf82b750bad58bd9808a638607da8 /cc/object.go | |
parent | 01344df46ee1744dd1ff7815705564deb43ac7cb (diff) | |
download | build_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.go | 11 |
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 -} |