blob: 4eb7220293c3308a91adeae0cfdadf7a462539e2 [file] [log] [blame]
Ivan Lozano183a3212019-10-18 14:18:45 -07001package cc
2
3import (
Ivan Lozano183a3212019-10-18 14:18:45 -07004 "android/soong/android"
Colin Cross6e511a92020-07-27 21:26:48 -07005
6 "github.com/google/blueprint"
Ivan Lozano183a3212019-10-18 14:18:45 -07007)
8
9type LinkableInterface interface {
10 Module() android.Module
11 CcLibrary() bool
12 CcLibraryInterface() bool
13
Ivan Lozano183a3212019-10-18 14:18:45 -070014 OutputFile() android.OptionalPath
Ivan Lozanoa0cd8f92020-04-09 09:56:02 -040015 CoverageFiles() android.Paths
Ivan Lozano183a3212019-10-18 14:18:45 -070016
Ivan Lozano2b262972019-11-21 12:30:50 -080017 NonCcVariants() bool
18
Colin Cross3572cf72020-10-01 15:58:11 -070019 StubsVersions(android.BaseMutatorContext) []string
Ivan Lozano52767be2019-10-18 14:49:46 -070020 BuildStubs() bool
Ivan Lozano183a3212019-10-18 14:18:45 -070021 SetBuildStubs()
Colin Crossd1f898e2020-08-18 18:35:15 -070022 SetStubsVersion(string)
Jooyung Han03b51852020-02-26 22:45:42 +090023 StubsVersion() string
Colin Crossd1f898e2020-08-18 18:35:15 -070024 SetAllStubsVersions([]string)
25 AllStubsVersions() []string
Ivan Lozano52767be2019-10-18 14:49:46 -070026 HasStubsVariants() bool
27 SelectedStl() string
28 ApiLevel() string
Ivan Lozano183a3212019-10-18 14:18:45 -070029
30 BuildStaticVariant() bool
31 BuildSharedVariant() bool
32 SetStatic()
33 SetShared()
Ivan Lozano52767be2019-10-18 14:49:46 -070034 Static() bool
35 Shared() bool
36 Toc() android.OptionalPath
37
Jooyung Han624d35c2020-04-10 12:57:24 +090038 Host() bool
39
Yifan Hong1b3348d2020-01-21 15:53:22 -080040 InRamdisk() bool
41 OnlyInRamdisk() bool
42
Ivan Lozano52767be2019-10-18 14:49:46 -070043 InRecovery() bool
44 OnlyInRecovery() bool
45
Colin Crossc511bc52020-04-07 16:50:32 +000046 UseSdk() bool
Ivan Lozano52767be2019-10-18 14:49:46 -070047 UseVndk() bool
48 MustUseVendorVariant() bool
49 IsVndk() bool
50 HasVendorVariant() bool
51
52 SdkVersion() string
Colin Crossc511bc52020-04-07 16:50:32 +000053 AlwaysSdk() bool
Jiyong Park2286afd2020-06-16 21:58:53 +090054 IsSdkVariant() bool
Ivan Lozano52767be2019-10-18 14:49:46 -070055
56 ToolchainLibrary() bool
57 NdkPrebuiltStl() bool
58 StubDecorator() bool
Colin Cross1348ce32020-10-01 13:37:16 -070059
60 SplitPerApiLevel() bool
Ivan Lozano183a3212019-10-18 14:18:45 -070061}
62
Colin Cross6e511a92020-07-27 21:26:48 -070063var (
64 CrtBeginDepTag = dependencyTag{name: "crtbegin"}
65 CrtEndDepTag = dependencyTag{name: "crtend"}
66 CoverageDepTag = dependencyTag{name: "coverage"}
67)
Ivan Lozano183a3212019-10-18 14:18:45 -070068
Colin Cross6e511a92020-07-27 21:26:48 -070069func SharedDepTag() blueprint.DependencyTag {
70 return libraryDependencyTag{Kind: sharedLibraryDependency}
Ivan Lozano183a3212019-10-18 14:18:45 -070071}
72
Colin Cross6e511a92020-07-27 21:26:48 -070073func StaticDepTag() blueprint.DependencyTag {
74 return libraryDependencyTag{Kind: staticLibraryDependency}
75}
Colin Cross0de8a1e2020-09-18 14:15:30 -070076
77type SharedLibraryInfo struct {
78 SharedLibrary android.Path
79 UnstrippedSharedLibrary android.Path
80
81 TableOfContents android.OptionalPath
82 CoverageSharedLibrary android.OptionalPath
83
84 StaticAnalogue *StaticLibraryInfo
85}
86
87var SharedLibraryInfoProvider = blueprint.NewProvider(SharedLibraryInfo{})
88
89type SharedLibraryImplementationStubsInfo struct {
90 SharedLibraryStubsInfos []SharedLibraryStubsInfo
91
92 IsLLNDK bool
93}
94
95var SharedLibraryImplementationStubsInfoProvider = blueprint.NewProvider(SharedLibraryImplementationStubsInfo{})
96
97type SharedLibraryStubsInfo struct {
98 Version string
99 SharedLibraryInfo SharedLibraryInfo
100 FlagExporterInfo FlagExporterInfo
101}
102
103var SharedLibraryStubsInfoProvider = blueprint.NewProvider(SharedLibraryStubsInfo{})
104
105type StaticLibraryInfo struct {
106 StaticLibrary android.Path
107 Objects Objects
108 ReuseObjects Objects
109
110 // This isn't the actual transitive DepSet, shared library dependencies have been
111 // converted into static library analogues. It is only used to order the static
112 // library dependencies that were specified for the current module.
113 TransitiveStaticLibrariesForOrdering *android.DepSet
114}
115
116var StaticLibraryInfoProvider = blueprint.NewProvider(StaticLibraryInfo{})
117
118type FlagExporterInfo struct {
119 IncludeDirs android.Paths
120 SystemIncludeDirs android.Paths
121 Flags []string
122 Deps android.Paths
123 GeneratedHeaders android.Paths
124}
125
126var FlagExporterInfoProvider = blueprint.NewProvider(FlagExporterInfo{})