Dedup prebuilt cc library creation am: ac6e608da7
am: eb66f93eea
Change-Id: I74abe1b99883874d3d5d0fc2c057a26697634468
This commit is contained in:
@@ -130,16 +130,8 @@ func (p *prebuiltLibraryLinker) disablePrebuilt() {
|
|||||||
p.properties.Srcs = nil
|
p.properties.Srcs = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// cc_prebuilt_library_shared installs a precompiled shared library that are
|
func NewPrebuiltLibrary(hod android.HostOrDeviceSupported) (*Module, *libraryDecorator) {
|
||||||
// listed in the srcs property in the device's directory.
|
|
||||||
func PrebuiltSharedLibraryFactory() android.Module {
|
|
||||||
module, _ := NewPrebuiltSharedLibrary(android.HostAndDeviceSupported)
|
|
||||||
return module.Init()
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewPrebuiltSharedLibrary(hod android.HostOrDeviceSupported) (*Module, *libraryDecorator) {
|
|
||||||
module, library := NewLibrary(hod)
|
module, library := NewLibrary(hod)
|
||||||
library.BuildOnlyShared()
|
|
||||||
module.compiler = nil
|
module.compiler = nil
|
||||||
|
|
||||||
prebuilt := &prebuiltLibraryLinker{
|
prebuilt := &prebuiltLibraryLinker{
|
||||||
@@ -151,9 +143,24 @@ func NewPrebuiltSharedLibrary(hod android.HostOrDeviceSupported) (*Module, *libr
|
|||||||
|
|
||||||
android.InitPrebuiltModule(module, &prebuilt.properties.Srcs)
|
android.InitPrebuiltModule(module, &prebuilt.properties.Srcs)
|
||||||
|
|
||||||
// Prebuilt libraries can be included in APEXes
|
// Prebuilt libraries can be used in SDKs.
|
||||||
android.InitApexModule(module)
|
|
||||||
android.InitSdkAwareModule(module)
|
android.InitSdkAwareModule(module)
|
||||||
|
return module, library
|
||||||
|
}
|
||||||
|
|
||||||
|
// cc_prebuilt_library_shared installs a precompiled shared library that are
|
||||||
|
// listed in the srcs property in the device's directory.
|
||||||
|
func PrebuiltSharedLibraryFactory() android.Module {
|
||||||
|
module, _ := NewPrebuiltSharedLibrary(android.HostAndDeviceSupported)
|
||||||
|
return module.Init()
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewPrebuiltSharedLibrary(hod android.HostOrDeviceSupported) (*Module, *libraryDecorator) {
|
||||||
|
module, library := NewPrebuiltLibrary(hod)
|
||||||
|
library.BuildOnlyShared()
|
||||||
|
|
||||||
|
// Prebuilt shared libraries can be included in APEXes
|
||||||
|
android.InitApexModule(module)
|
||||||
|
|
||||||
return module, library
|
return module, library
|
||||||
}
|
}
|
||||||
@@ -166,19 +173,8 @@ func PrebuiltStaticLibraryFactory() android.Module {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func NewPrebuiltStaticLibrary(hod android.HostOrDeviceSupported) (*Module, *libraryDecorator) {
|
func NewPrebuiltStaticLibrary(hod android.HostOrDeviceSupported) (*Module, *libraryDecorator) {
|
||||||
module, library := NewLibrary(hod)
|
module, library := NewPrebuiltLibrary(hod)
|
||||||
library.BuildOnlyStatic()
|
library.BuildOnlyStatic()
|
||||||
module.compiler = nil
|
|
||||||
|
|
||||||
prebuilt := &prebuiltLibraryLinker{
|
|
||||||
libraryDecorator: library,
|
|
||||||
}
|
|
||||||
module.linker = prebuilt
|
|
||||||
|
|
||||||
module.AddProperties(&prebuilt.properties)
|
|
||||||
|
|
||||||
android.InitPrebuiltModule(module, &prebuilt.properties.Srcs)
|
|
||||||
android.InitSdkAwareModule(module)
|
|
||||||
return module, library
|
return module, library
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user