Make factory functions in cc/prebuilt.go public.

Test: refactoring CL.

Change-Id: Icf4628df082d2b5a41a9108f85cb73dab42839ab
This commit is contained in:
Leo Li 2017-05-17 11:30:45 -07:00
parent 2c13abc95e
commit 74f7b97d3f
1 changed files with 21 additions and 6 deletions

View File

@ -66,7 +66,12 @@ func (p *prebuiltLibraryLinker) link(ctx ModuleContext,
}
func prebuiltSharedLibraryFactory() (blueprint.Module, []interface{}) {
module, library := NewLibrary(android.HostAndDeviceSupported)
module, _ := NewPrebuiltSharedLibrary(android.HostAndDeviceSupported)
return module.Init()
}
func NewPrebuiltSharedLibrary(hod android.HostOrDeviceSupported) (*Module, *libraryDecorator) {
module, library := NewLibrary(hod)
library.BuildOnlyShared()
module.compiler = nil
@ -75,11 +80,16 @@ func prebuiltSharedLibraryFactory() (blueprint.Module, []interface{}) {
}
module.linker = prebuilt
return module.Init()
return module, library
}
func prebuiltStaticLibraryFactory() (blueprint.Module, []interface{}) {
module, library := NewLibrary(android.HostAndDeviceSupported)
module, _ := NewPrebuiltStaticLibrary(android.HostAndDeviceSupported)
return module.Init()
}
func NewPrebuiltStaticLibrary(hod android.HostOrDeviceSupported) (*Module, *libraryDecorator) {
module, library := NewLibrary(hod)
library.BuildOnlyStatic()
module.compiler = nil
@ -88,7 +98,7 @@ func prebuiltStaticLibraryFactory() (blueprint.Module, []interface{}) {
}
module.linker = prebuilt
return module.Init()
return module, library
}
type prebuiltBinaryLinker struct {
@ -115,7 +125,12 @@ func (p *prebuiltBinaryLinker) link(ctx ModuleContext,
}
func prebuiltBinaryFactory() (blueprint.Module, []interface{}) {
module, binary := NewBinary(android.HostAndDeviceSupported)
module, _ := NewPrebuiltBinary(android.HostAndDeviceSupported)
return module.Init()
}
func NewPrebuiltBinary(hod android.HostOrDeviceSupported) (*Module, *binaryDecorator) {
module, binary := NewBinary(hod)
module.compiler = nil
prebuilt := &prebuiltBinaryLinker{
@ -123,5 +138,5 @@ func prebuiltBinaryFactory() (blueprint.Module, []interface{}) {
}
module.linker = prebuilt
return module.Init()
return module, binary
}