Fix llndk_library init am: 4f4f8ebd3f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1541062 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: I36aa5958cfe9484a19ce92cb1187d43d43a0024b
This commit is contained in:
@@ -1738,12 +1738,9 @@ func LinkageMutator(mctx android.BottomUpMutatorContext) {
|
|||||||
|
|
||||||
isLLNDK := false
|
isLLNDK := false
|
||||||
if m, ok := mctx.Module().(*Module); ok {
|
if m, ok := mctx.Module().(*Module); ok {
|
||||||
isLLNDK = m.IsLlndk()
|
|
||||||
// Don't count the vestigial llndk_library module as isLLNDK, it needs a static
|
// Don't count the vestigial llndk_library module as isLLNDK, it needs a static
|
||||||
// variant so that a cc_library_prebuilt can depend on it.
|
// variant so that a cc_library_prebuilt can depend on it.
|
||||||
if _, ok := m.linker.(*llndkStubDecorator); ok {
|
isLLNDK = m.IsLlndk() && !isVestigialLLNDKModule(m)
|
||||||
isLLNDK = false
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
buildStatic := library.BuildStaticVariant() && !isLLNDK
|
buildStatic := library.BuildStaticVariant() && !isLLNDK
|
||||||
buildShared := library.BuildSharedVariant()
|
buildShared := library.BuildSharedVariant()
|
||||||
|
@@ -100,6 +100,11 @@ func (stub *llndkStubDecorator) Name(name string) string {
|
|||||||
return name + llndkLibrarySuffix
|
return name + llndkLibrarySuffix
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (stub *llndkStubDecorator) linkerProps() []interface{} {
|
||||||
|
props := stub.libraryDecorator.linkerProps()
|
||||||
|
return append(props, &stub.Properties)
|
||||||
|
}
|
||||||
|
|
||||||
func (stub *llndkStubDecorator) linkerFlags(ctx ModuleContext, flags Flags) Flags {
|
func (stub *llndkStubDecorator) linkerFlags(ctx ModuleContext, flags Flags) Flags {
|
||||||
stub.libraryDecorator.libName = stub.implementationModuleName(ctx.ModuleName())
|
stub.libraryDecorator.libName = stub.implementationModuleName(ctx.ModuleName())
|
||||||
return stub.libraryDecorator.linkerFlags(ctx, flags)
|
return stub.libraryDecorator.linkerFlags(ctx, flags)
|
||||||
@@ -137,12 +142,6 @@ func NewLLndkStubLibrary() *Module {
|
|||||||
module.installer = nil
|
module.installer = nil
|
||||||
module.library = stub
|
module.library = stub
|
||||||
|
|
||||||
module.AddProperties(
|
|
||||||
&module.Properties,
|
|
||||||
&stub.Properties,
|
|
||||||
&library.MutatedProperties,
|
|
||||||
&library.flagExporter.Properties)
|
|
||||||
|
|
||||||
return module
|
return module
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -156,8 +155,14 @@ func NewLLndkStubLibrary() *Module {
|
|||||||
// }
|
// }
|
||||||
func LlndkLibraryFactory() android.Module {
|
func LlndkLibraryFactory() android.Module {
|
||||||
module := NewLLndkStubLibrary()
|
module := NewLLndkStubLibrary()
|
||||||
android.InitAndroidArchModule(module, android.DeviceSupported, android.MultilibBoth)
|
return module.Init()
|
||||||
return module
|
}
|
||||||
|
|
||||||
|
// isVestigialLLNDKModule returns true if m is a vestigial llndk_library module used to provide
|
||||||
|
// properties to the LLNDK variant of a cc_library.
|
||||||
|
func isVestigialLLNDKModule(m *Module) bool {
|
||||||
|
_, ok := m.linker.(*llndkStubDecorator)
|
||||||
|
return ok
|
||||||
}
|
}
|
||||||
|
|
||||||
type llndkHeadersDecorator struct {
|
type llndkHeadersDecorator struct {
|
||||||
|
Reference in New Issue
Block a user