blob: 0609b288d8c73199a2699913b3a37c1478a3c74f [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
Ivan Lozano52767be2019-10-18 14:49:46 -070019 SelectedStl() string
Ivan Lozano183a3212019-10-18 14:18:45 -070020
21 BuildStaticVariant() bool
22 BuildSharedVariant() bool
23 SetStatic()
24 SetShared()
Ivan Lozano52767be2019-10-18 14:49:46 -070025 Static() bool
26 Shared() bool
27 Toc() android.OptionalPath
28
Jooyung Han624d35c2020-04-10 12:57:24 +090029 Host() bool
30
Yifan Hong1b3348d2020-01-21 15:53:22 -080031 InRamdisk() bool
32 OnlyInRamdisk() bool
33
Yifan Hong60e0cfb2020-10-21 15:17:56 -070034 InVendorRamdisk() bool
35 OnlyInVendorRamdisk() bool
36
Ivan Lozano52767be2019-10-18 14:49:46 -070037 InRecovery() bool
38 OnlyInRecovery() bool
39
Colin Crossc511bc52020-04-07 16:50:32 +000040 UseSdk() bool
Ivan Lozano52767be2019-10-18 14:49:46 -070041 UseVndk() bool
42 MustUseVendorVariant() bool
43 IsVndk() bool
44 HasVendorVariant() bool
45
46 SdkVersion() string
Colin Crossc511bc52020-04-07 16:50:32 +000047 AlwaysSdk() bool
Jiyong Park2286afd2020-06-16 21:58:53 +090048 IsSdkVariant() bool
Ivan Lozano52767be2019-10-18 14:49:46 -070049
Colin Cross1348ce32020-10-01 13:37:16 -070050 SplitPerApiLevel() bool
Ivan Lozano183a3212019-10-18 14:18:45 -070051}
52
Colin Cross6e511a92020-07-27 21:26:48 -070053var (
54 CrtBeginDepTag = dependencyTag{name: "crtbegin"}
55 CrtEndDepTag = dependencyTag{name: "crtend"}
56 CoverageDepTag = dependencyTag{name: "coverage"}
57)
Ivan Lozano183a3212019-10-18 14:18:45 -070058
Colin Cross6e511a92020-07-27 21:26:48 -070059func SharedDepTag() blueprint.DependencyTag {
60 return libraryDependencyTag{Kind: sharedLibraryDependency}
Ivan Lozano183a3212019-10-18 14:18:45 -070061}
62
Colin Cross6e511a92020-07-27 21:26:48 -070063func StaticDepTag() blueprint.DependencyTag {
64 return libraryDependencyTag{Kind: staticLibraryDependency}
65}
Colin Cross0de8a1e2020-09-18 14:15:30 -070066
Zach Johnson3df4e632020-11-06 11:56:27 -080067func HeaderDepTag() blueprint.DependencyTag {
68 return libraryDependencyTag{Kind: headerLibraryDependency}
69}
70
Colin Cross0de8a1e2020-09-18 14:15:30 -070071type SharedLibraryInfo struct {
72 SharedLibrary android.Path
73 UnstrippedSharedLibrary android.Path
74
75 TableOfContents android.OptionalPath
76 CoverageSharedLibrary android.OptionalPath
77
78 StaticAnalogue *StaticLibraryInfo
79}
80
81var SharedLibraryInfoProvider = blueprint.NewProvider(SharedLibraryInfo{})
82
83type SharedLibraryImplementationStubsInfo struct {
84 SharedLibraryStubsInfos []SharedLibraryStubsInfo
85
86 IsLLNDK bool
87}
88
89var SharedLibraryImplementationStubsInfoProvider = blueprint.NewProvider(SharedLibraryImplementationStubsInfo{})
90
91type SharedLibraryStubsInfo struct {
92 Version string
93 SharedLibraryInfo SharedLibraryInfo
94 FlagExporterInfo FlagExporterInfo
95}
96
97var SharedLibraryStubsInfoProvider = blueprint.NewProvider(SharedLibraryStubsInfo{})
98
99type StaticLibraryInfo struct {
100 StaticLibrary android.Path
101 Objects Objects
102 ReuseObjects Objects
103
104 // This isn't the actual transitive DepSet, shared library dependencies have been
105 // converted into static library analogues. It is only used to order the static
106 // library dependencies that were specified for the current module.
107 TransitiveStaticLibrariesForOrdering *android.DepSet
108}
109
110var StaticLibraryInfoProvider = blueprint.NewProvider(StaticLibraryInfo{})
111
112type FlagExporterInfo struct {
113 IncludeDirs android.Paths
114 SystemIncludeDirs android.Paths
115 Flags []string
116 Deps android.Paths
117 GeneratedHeaders android.Paths
118}
119
120var FlagExporterInfoProvider = blueprint.NewProvider(FlagExporterInfo{})