platform_build_soong/cc/linkable.go
Colin Cross d1f898e70a Remove global state from version mutator
A per-context variable is used to store the list of modules that
contain stubs and their available versions.  Stores the list of the
stubs versions on the implementation module, and then use the new
return values from AddVariationDependencies to expand dependencies
on implementation libraries to also depend on the stubs libraries.
Adds a new mutator pass to propagate list of stub versions to llndk
libraries.

Also creates an alias version variation called "latest" to allow
depending on the latest version without having to know what it is.

Test: all Soong tests
Test: no change to build.ninja, Android-${TARGET_PRODUCT}.mk, make_vars-${TARGET_PRODUCT}.mk or late-${TARGET_PRODUCT}.mk
Change-Id: If19659e2e5828c860fd4d679ef79a414b7ea2efc
2020-09-17 18:56:59 -07:00

80 lines
1.5 KiB
Go

package cc
import (
"android/soong/android"
"github.com/google/blueprint"
)
type LinkableInterface interface {
Module() android.Module
CcLibrary() bool
CcLibraryInterface() bool
OutputFile() android.OptionalPath
CoverageFiles() android.Paths
IncludeDirs() android.Paths
SetDepsInLinkOrder([]android.Path)
GetDepsInLinkOrder() []android.Path
HasStaticVariant() bool
GetStaticVariant() LinkableInterface
NonCcVariants() bool
StubsVersions() []string
BuildStubs() bool
SetBuildStubs()
SetStubsVersion(string)
StubsVersion() string
SetAllStubsVersions([]string)
AllStubsVersions() []string
HasStubsVariants() bool
SelectedStl() string
ApiLevel() string
BuildStaticVariant() bool
BuildSharedVariant() bool
SetStatic()
SetShared()
Static() bool
Shared() bool
Toc() android.OptionalPath
Host() bool
InRamdisk() bool
OnlyInRamdisk() bool
InRecovery() bool
OnlyInRecovery() bool
UseSdk() bool
UseVndk() bool
MustUseVendorVariant() bool
IsVndk() bool
HasVendorVariant() bool
SdkVersion() string
AlwaysSdk() bool
IsSdkVariant() bool
ToolchainLibrary() bool
NdkPrebuiltStl() bool
StubDecorator() bool
}
var (
CrtBeginDepTag = dependencyTag{name: "crtbegin"}
CrtEndDepTag = dependencyTag{name: "crtend"}
CoverageDepTag = dependencyTag{name: "coverage"}
)
func SharedDepTag() blueprint.DependencyTag {
return libraryDependencyTag{Kind: sharedLibraryDependency}
}
func StaticDepTag() blueprint.DependencyTag {
return libraryDependencyTag{Kind: staticLibraryDependency}
}