Ivan Lozano | 183a321 | 2019-10-18 14:18:45 -0700 | [diff] [blame] | 1 | package cc |
| 2 | |
| 3 | import ( |
Ivan Lozano | 183a321 | 2019-10-18 14:18:45 -0700 | [diff] [blame] | 4 | "android/soong/android" |
Ivan Lozano | 0f9963e | 2023-02-06 13:31:02 -0500 | [diff] [blame] | 5 | "android/soong/fuzz" |
Colin Cross | 6e511a9 | 2020-07-27 21:26:48 -0700 | [diff] [blame] | 6 | |
| 7 | "github.com/google/blueprint" |
Colin Cross | a14fb6a | 2024-10-23 16:57:06 -0700 | [diff] [blame] | 8 | "github.com/google/blueprint/depset" |
Ivan Lozano | 183a321 | 2019-10-18 14:18:45 -0700 | [diff] [blame] | 9 | ) |
| 10 | |
Ivan Lozano | 3968d8f | 2020-12-14 11:27:52 -0500 | [diff] [blame] | 11 | // PlatformSanitizeable is an interface for sanitizing platform modules. |
| 12 | type PlatformSanitizeable interface { |
| 13 | LinkableInterface |
| 14 | |
| 15 | // SanitizePropDefined returns whether the Sanitizer properties struct for this module is defined. |
| 16 | SanitizePropDefined() bool |
| 17 | |
Ivan Lozano | 3968d8f | 2020-12-14 11:27:52 -0500 | [diff] [blame] | 18 | // IsSanitizerEnabled returns whether a sanitizer is enabled. |
| 19 | IsSanitizerEnabled(t SanitizerType) bool |
| 20 | |
| 21 | // IsSanitizerExplicitlyDisabled returns whether a sanitizer has been explicitly disabled (set to false) rather |
| 22 | // than left undefined. |
| 23 | IsSanitizerExplicitlyDisabled(t SanitizerType) bool |
| 24 | |
Ivan Lozano | 3968d8f | 2020-12-14 11:27:52 -0500 | [diff] [blame] | 25 | // SetSanitizer enables or disables the specified sanitizer type if it's supported, otherwise this should panic. |
| 26 | SetSanitizer(t SanitizerType, b bool) |
| 27 | |
Ivan Lozano | 3968d8f | 2020-12-14 11:27:52 -0500 | [diff] [blame] | 28 | // StaticallyLinked returns true if the module is statically linked. |
| 29 | StaticallyLinked() bool |
| 30 | |
| 31 | // SetInSanitizerDir sets the module installation to the sanitizer directory. |
| 32 | SetInSanitizerDir() |
| 33 | |
| 34 | // SanitizeNever returns true if this module should never be sanitized. |
| 35 | SanitizeNever() bool |
| 36 | |
| 37 | // SanitizerSupported returns true if a sanitizer type is supported by this modules compiler. |
| 38 | SanitizerSupported(t SanitizerType) bool |
| 39 | |
Ivan Lozano | d7586b6 | 2021-04-01 09:49:36 -0400 | [diff] [blame] | 40 | // MinimalRuntimeDep returns true if this module needs to link the minimal UBSan runtime, |
| 41 | // either because it requires it or because a dependent module which requires it to be linked in this module. |
| 42 | MinimalRuntimeDep() bool |
| 43 | |
| 44 | // UbsanRuntimeDep returns true if this module needs to link the full UBSan runtime, |
| 45 | // either because it requires it or because a dependent module which requires it to be linked in this module. |
| 46 | UbsanRuntimeDep() bool |
| 47 | |
| 48 | // UbsanRuntimeNeeded returns true if the full UBSan runtime is required by this module. |
| 49 | UbsanRuntimeNeeded() bool |
| 50 | |
| 51 | // MinimalRuntimeNeeded returns true if the minimal UBSan runtime is required by this module |
| 52 | MinimalRuntimeNeeded() bool |
| 53 | |
Ivan Lozano | 3968d8f | 2020-12-14 11:27:52 -0500 | [diff] [blame] | 54 | // SanitizableDepTagChecker returns a SantizableDependencyTagChecker function type. |
| 55 | SanitizableDepTagChecker() SantizableDependencyTagChecker |
| 56 | } |
| 57 | |
| 58 | // SantizableDependencyTagChecker functions check whether or not a dependency |
| 59 | // tag can be sanitized. These functions should return true if the tag can be |
| 60 | // sanitized, otherwise they should return false. These functions should also |
| 61 | // handle all possible dependency tags in the dependency tree. For example, |
| 62 | // Rust modules can depend on both Rust and CC libraries, so the Rust module |
| 63 | // implementation should handle tags from both. |
| 64 | type SantizableDependencyTagChecker func(tag blueprint.DependencyTag) bool |
| 65 | |
Chris Parsons | 3c27ca3 | 2020-11-20 12:42:07 -0500 | [diff] [blame] | 66 | // LinkableInterface is an interface for a type of module that is linkable in a C++ library. |
Ivan Lozano | 183a321 | 2019-10-18 14:18:45 -0700 | [diff] [blame] | 67 | type LinkableInterface interface { |
Ivan Lozano | f9e2172 | 2020-12-02 09:00:51 -0500 | [diff] [blame] | 68 | android.Module |
| 69 | |
Ivan Lozano | 183a321 | 2019-10-18 14:18:45 -0700 | [diff] [blame] | 70 | Module() android.Module |
| 71 | CcLibrary() bool |
| 72 | CcLibraryInterface() bool |
| 73 | |
Ivan Lozano | 61c02cc | 2023-06-09 14:06:44 -0400 | [diff] [blame] | 74 | // RustLibraryInterface returns true if this is a Rust library module |
| 75 | RustLibraryInterface() bool |
| 76 | |
Ivan Lozano | 0a468a4 | 2024-05-13 21:03:34 -0400 | [diff] [blame] | 77 | // CrateName returns the crateName for a Rust library, panics if not a Rust library. |
| 78 | CrateName() string |
| 79 | |
| 80 | // DepFlags returns a slice of Rustc string flags, panics if not a Rust library |
| 81 | ExportedCrateLinkDirs() []string |
| 82 | |
Ivan Lozano | d7586b6 | 2021-04-01 09:49:36 -0400 | [diff] [blame] | 83 | // BaseModuleName returns the android.ModuleBase.BaseModuleName() value for this module. |
| 84 | BaseModuleName() string |
| 85 | |
Ivan Lozano | 183a321 | 2019-10-18 14:18:45 -0700 | [diff] [blame] | 86 | OutputFile() android.OptionalPath |
Ivan Lozano | 39b0bf0 | 2021-10-14 12:22:09 -0400 | [diff] [blame] | 87 | UnstrippedOutputFile() android.Path |
Ivan Lozano | a0cd8f9 | 2020-04-09 09:56:02 -0400 | [diff] [blame] | 88 | CoverageFiles() android.Paths |
Ivan Lozano | 183a321 | 2019-10-18 14:18:45 -0700 | [diff] [blame] | 89 | |
Ivan Lozano | 7f67c2a | 2022-06-27 16:00:26 -0400 | [diff] [blame] | 90 | // CoverageOutputFile returns the output archive of gcno coverage information files. |
| 91 | CoverageOutputFile() android.OptionalPath |
| 92 | |
Ivan Lozano | 2b26297 | 2019-11-21 12:30:50 -0800 | [diff] [blame] | 93 | NonCcVariants() bool |
| 94 | |
Ivan Lozano | 52767be | 2019-10-18 14:49:46 -0700 | [diff] [blame] | 95 | SelectedStl() string |
Ivan Lozano | 183a321 | 2019-10-18 14:18:45 -0700 | [diff] [blame] | 96 | |
| 97 | BuildStaticVariant() bool |
Ivan Lozano | fd47b1a | 2024-05-17 14:13:41 -0400 | [diff] [blame] | 98 | BuildRlibVariant() bool |
Ivan Lozano | 183a321 | 2019-10-18 14:18:45 -0700 | [diff] [blame] | 99 | BuildSharedVariant() bool |
| 100 | SetStatic() |
| 101 | SetShared() |
Ivan Lozano | 3968d8f | 2020-12-14 11:27:52 -0500 | [diff] [blame] | 102 | IsPrebuilt() bool |
Ivan Lozano | 52767be | 2019-10-18 14:49:46 -0700 | [diff] [blame] | 103 | Toc() android.OptionalPath |
| 104 | |
Ivan Lozano | fd47b1a | 2024-05-17 14:13:41 -0400 | [diff] [blame] | 105 | // IsRustFFI returns true if this is a Rust FFI library. |
| 106 | IsRustFFI() bool |
| 107 | |
Ivan Lozano | 0f9963e | 2023-02-06 13:31:02 -0500 | [diff] [blame] | 108 | // IsFuzzModule returns true if this a *_fuzz module. |
| 109 | IsFuzzModule() bool |
| 110 | |
| 111 | // FuzzPackagedModule returns the fuzz.FuzzPackagedModule for this module. |
| 112 | // Expects that IsFuzzModule returns true. |
| 113 | FuzzPackagedModule() fuzz.FuzzPackagedModule |
| 114 | |
| 115 | // FuzzSharedLibraries returns the shared library dependencies for this module. |
| 116 | // Expects that IsFuzzModule returns true. |
Hamzeh Zawawy | 3891749 | 2023-04-05 22:08:46 +0000 | [diff] [blame] | 117 | FuzzSharedLibraries() android.RuleBuilderInstalls |
Ivan Lozano | 0f9963e | 2023-02-06 13:31:02 -0500 | [diff] [blame] | 118 | |
Yi-Yo Chiang | 36d8e4e | 2021-07-02 21:21:13 +0800 | [diff] [blame] | 119 | Device() bool |
Jooyung Han | 624d35c | 2020-04-10 12:57:24 +0900 | [diff] [blame] | 120 | Host() bool |
| 121 | |
Yifan Hong | 1b3348d | 2020-01-21 15:53:22 -0800 | [diff] [blame] | 122 | InRamdisk() bool |
| 123 | OnlyInRamdisk() bool |
| 124 | |
Yifan Hong | 60e0cfb | 2020-10-21 15:17:56 -0700 | [diff] [blame] | 125 | InVendorRamdisk() bool |
| 126 | OnlyInVendorRamdisk() bool |
| 127 | |
Ivan Lozano | 52767be | 2019-10-18 14:49:46 -0700 | [diff] [blame] | 128 | InRecovery() bool |
| 129 | OnlyInRecovery() bool |
| 130 | |
Ivan Lozano | 3968d8f | 2020-12-14 11:27:52 -0500 | [diff] [blame] | 131 | InVendor() bool |
| 132 | |
Colin Cross | c511bc5 | 2020-04-07 16:50:32 +0000 | [diff] [blame] | 133 | UseSdk() bool |
Ivan Lozano | 3a7d000 | 2021-03-30 12:19:36 -0400 | [diff] [blame] | 134 | |
Ivan Lozano | 7f67c2a | 2022-06-27 16:00:26 -0400 | [diff] [blame] | 135 | // IsNdk returns true if the library is in the configs known NDK list. |
| 136 | IsNdk(config android.Config) bool |
| 137 | |
| 138 | // IsStubs returns true if the this is a stubs library. |
| 139 | IsStubs() bool |
| 140 | |
Ivan Lozano | 3a7d000 | 2021-03-30 12:19:36 -0400 | [diff] [blame] | 141 | // IsLlndk returns true for both LLNDK (public) and LLNDK-private libs. |
| 142 | IsLlndk() bool |
| 143 | |
Ivan Lozano | d7586b6 | 2021-04-01 09:49:36 -0400 | [diff] [blame] | 144 | // HasLlndkStubs returns true if this library has a variant that will build LLNDK stubs. |
| 145 | HasLlndkStubs() bool |
| 146 | |
Colin Cross | 1f3f130 | 2021-04-26 18:37:44 -0700 | [diff] [blame] | 147 | // NeedsLlndkVariants returns true if this module has LLNDK stubs or provides LLNDK headers. |
| 148 | NeedsLlndkVariants() bool |
Ivan Lozano | 3a7d000 | 2021-03-30 12:19:36 -0400 | [diff] [blame] | 149 | |
Colin Cross | 5271fea | 2021-04-27 13:06:04 -0700 | [diff] [blame] | 150 | // NeedsVendorPublicLibraryVariants returns true if this module has vendor public library stubs. |
| 151 | NeedsVendorPublicLibraryVariants() bool |
| 152 | |
Ivan Lozano | d7586b6 | 2021-04-01 09:49:36 -0400 | [diff] [blame] | 153 | //StubsVersion returns the stubs version for this module. |
| 154 | StubsVersion() string |
| 155 | |
| 156 | // UseVndk returns true if the module is using VNDK libraries instead of the libraries in /system/lib or /system/lib64. |
| 157 | // "product" and "vendor" variant modules return true for this function. |
| 158 | // When BOARD_VNDK_VERSION is set, vendor variants of "vendor_available: true", "vendor: true", |
| 159 | // "soc_specific: true" and more vendor installed modules are included here. |
| 160 | // When PRODUCT_PRODUCT_VNDK_VERSION is set, product variants of "vendor_available: true" or |
| 161 | // "product_specific: true" modules are included here. |
Ivan Lozano | 52767be | 2019-10-18 14:49:46 -0700 | [diff] [blame] | 162 | UseVndk() bool |
Ivan Lozano | d7586b6 | 2021-04-01 09:49:36 -0400 | [diff] [blame] | 163 | |
Jiyong Park | 7d55b61 | 2021-06-11 17:22:09 +0900 | [diff] [blame] | 164 | // Bootstrap tests if this module is allowed to use non-APEX version of libraries. |
| 165 | Bootstrap() bool |
| 166 | |
Ivan Lozano | f1868af | 2022-04-12 13:08:36 -0400 | [diff] [blame] | 167 | IsVendorPublicLibrary() bool |
| 168 | IsVndkPrebuiltLibrary() bool |
Ivan Lozano | 52767be | 2019-10-18 14:49:46 -0700 | [diff] [blame] | 169 | HasVendorVariant() bool |
Justin Yun | cbca373 | 2021-02-03 19:24:13 +0900 | [diff] [blame] | 170 | HasProductVariant() bool |
| 171 | HasNonSystemVariants() bool |
Ivan Lozano | f1868af | 2022-04-12 13:08:36 -0400 | [diff] [blame] | 172 | ProductSpecific() bool |
Ivan Lozano | f9e2172 | 2020-12-02 09:00:51 -0500 | [diff] [blame] | 173 | InProduct() bool |
Ivan Lozano | f1868af | 2022-04-12 13:08:36 -0400 | [diff] [blame] | 174 | SdkAndPlatformVariantVisibleToMake() bool |
Kiyoung Kim | aa39480 | 2024-01-08 12:55:45 +0900 | [diff] [blame] | 175 | InVendorOrProduct() bool |
Ivan Lozano | 52767be | 2019-10-18 14:49:46 -0700 | [diff] [blame] | 176 | |
Ivan Lozano | c08897c | 2021-04-02 12:41:32 -0400 | [diff] [blame] | 177 | // SubName returns the modules SubName, used for image and NDK/SDK variations. |
| 178 | SubName() string |
| 179 | |
Ivan Lozano | 52767be | 2019-10-18 14:49:46 -0700 | [diff] [blame] | 180 | SdkVersion() string |
Jiyong Park | fdaa5f7 | 2021-03-19 22:18:04 +0900 | [diff] [blame] | 181 | MinSdkVersion() string |
Colin Cross | c511bc5 | 2020-04-07 16:50:32 +0000 | [diff] [blame] | 182 | AlwaysSdk() bool |
Jiyong Park | 2286afd | 2020-06-16 21:58:53 +0900 | [diff] [blame] | 183 | IsSdkVariant() bool |
Ivan Lozano | 52767be | 2019-10-18 14:49:46 -0700 | [diff] [blame] | 184 | |
Colin Cross | 1348ce3 | 2020-10-01 13:37:16 -0700 | [diff] [blame] | 185 | SplitPerApiLevel() bool |
Ivan Lozano | 3968d8f | 2020-12-14 11:27:52 -0500 | [diff] [blame] | 186 | |
| 187 | // SetPreventInstall sets the PreventInstall property to 'true' for this module. |
| 188 | SetPreventInstall() |
| 189 | // SetHideFromMake sets the HideFromMake property to 'true' for this module. |
| 190 | SetHideFromMake() |
Ivan Lozano | 3a7d000 | 2021-03-30 12:19:36 -0400 | [diff] [blame] | 191 | |
| 192 | // KernelHeadersDecorator returns true if this is a kernel headers decorator module. |
| 193 | // This is specific to cc and should always return false for all other packages. |
| 194 | KernelHeadersDecorator() bool |
Ivan Lozano | d7586b6 | 2021-04-01 09:49:36 -0400 | [diff] [blame] | 195 | |
| 196 | // HiddenFromMake returns true if this module is hidden from Make. |
| 197 | HiddenFromMake() bool |
| 198 | |
| 199 | // RelativeInstallPath returns the relative install path for this module. |
| 200 | RelativeInstallPath() string |
| 201 | |
| 202 | // Binary returns true if this is a binary module. |
| 203 | Binary() bool |
| 204 | |
| 205 | // Object returns true if this is an object module. |
| 206 | Object() bool |
| 207 | |
| 208 | // Rlib returns true if this is an rlib module. |
| 209 | Rlib() bool |
| 210 | |
| 211 | // Dylib returns true if this is an dylib module. |
| 212 | Dylib() bool |
| 213 | |
Ivan Lozano | add122a | 2023-07-13 11:01:41 -0400 | [diff] [blame] | 214 | // RlibStd returns true if this is an rlib which links against an rlib libstd. |
| 215 | RlibStd() bool |
| 216 | |
Ivan Lozano | d7586b6 | 2021-04-01 09:49:36 -0400 | [diff] [blame] | 217 | // Static returns true if this is a static library module. |
| 218 | Static() bool |
| 219 | |
| 220 | // Shared returns true if this is a shared library module. |
| 221 | Shared() bool |
| 222 | |
| 223 | // Header returns true if this is a library headers module. |
| 224 | Header() bool |
| 225 | |
Justin Yun | 5e03586 | 2021-06-29 20:50:37 +0900 | [diff] [blame] | 226 | // StaticExecutable returns true if this is a binary module with "static_executable: true". |
| 227 | StaticExecutable() bool |
| 228 | |
Ivan Lozano | d7586b6 | 2021-04-01 09:49:36 -0400 | [diff] [blame] | 229 | // EverInstallable returns true if the module is ever installable |
| 230 | EverInstallable() bool |
| 231 | |
| 232 | // PreventInstall returns true if this module is prevented from installation. |
| 233 | PreventInstall() bool |
| 234 | |
| 235 | // InstallInData returns true if this module is installed in data. |
| 236 | InstallInData() bool |
| 237 | |
| 238 | // Installable returns a bool pointer to the module installable property. |
| 239 | Installable() *bool |
| 240 | |
| 241 | // Symlinks returns a list of symlinks that should be created for this module. |
| 242 | Symlinks() []string |
| 243 | |
| 244 | // VndkVersion returns the VNDK version string for this module. |
| 245 | VndkVersion() string |
Jihoon Kang | f78a890 | 2022-09-01 22:47:07 +0000 | [diff] [blame] | 246 | |
| 247 | // Partition returns the partition string for this module. |
| 248 | Partition() string |
Ivan Lozano | 0f9963e | 2023-02-06 13:31:02 -0500 | [diff] [blame] | 249 | |
| 250 | // FuzzModule returns the fuzz.FuzzModule associated with the module. |
| 251 | FuzzModuleStruct() fuzz.FuzzModule |
Ivan Lozano | 183a321 | 2019-10-18 14:18:45 -0700 | [diff] [blame] | 252 | } |
| 253 | |
Colin Cross | 6e511a9 | 2020-07-27 21:26:48 -0700 | [diff] [blame] | 254 | var ( |
Chris Parsons | 3c27ca3 | 2020-11-20 12:42:07 -0500 | [diff] [blame] | 255 | // Dependency tag for crtbegin, an object file responsible for initialization. |
Colin Cross | 6e511a9 | 2020-07-27 21:26:48 -0700 | [diff] [blame] | 256 | CrtBeginDepTag = dependencyTag{name: "crtbegin"} |
Chris Parsons | 3c27ca3 | 2020-11-20 12:42:07 -0500 | [diff] [blame] | 257 | // Dependency tag for crtend, an object file responsible for program termination. |
| 258 | CrtEndDepTag = dependencyTag{name: "crtend"} |
| 259 | // Dependency tag for coverage library. |
Colin Cross | 6e511a9 | 2020-07-27 21:26:48 -0700 | [diff] [blame] | 260 | CoverageDepTag = dependencyTag{name: "coverage"} |
| 261 | ) |
Ivan Lozano | 183a321 | 2019-10-18 14:18:45 -0700 | [diff] [blame] | 262 | |
Ivan Lozano | 3968d8f | 2020-12-14 11:27:52 -0500 | [diff] [blame] | 263 | // GetImageVariantType returns the ImageVariantType string value for the given module |
| 264 | // (these are defined in cc/image.go). |
| 265 | func GetImageVariantType(c LinkableInterface) ImageVariantType { |
| 266 | if c.Host() { |
| 267 | return hostImageVariant |
| 268 | } else if c.InVendor() { |
| 269 | return vendorImageVariant |
| 270 | } else if c.InProduct() { |
| 271 | return productImageVariant |
| 272 | } else if c.InRamdisk() { |
| 273 | return ramdiskImageVariant |
| 274 | } else if c.InVendorRamdisk() { |
| 275 | return vendorRamdiskImageVariant |
| 276 | } else if c.InRecovery() { |
| 277 | return recoveryImageVariant |
| 278 | } else { |
| 279 | return coreImageVariant |
| 280 | } |
| 281 | } |
| 282 | |
Ivan Lozano | c08897c | 2021-04-02 12:41:32 -0400 | [diff] [blame] | 283 | // DepTagMakeSuffix returns the makeSuffix value of a particular library dependency tag. |
| 284 | // Returns an empty string if not a library dependency tag. |
| 285 | func DepTagMakeSuffix(depTag blueprint.DependencyTag) string { |
| 286 | if libDepTag, ok := depTag.(libraryDependencyTag); ok { |
| 287 | return libDepTag.makeSuffix |
| 288 | } |
| 289 | return "" |
| 290 | } |
| 291 | |
Chris Parsons | 3c27ca3 | 2020-11-20 12:42:07 -0500 | [diff] [blame] | 292 | // SharedDepTag returns the dependency tag for any C++ shared libraries. |
Colin Cross | 6e511a9 | 2020-07-27 21:26:48 -0700 | [diff] [blame] | 293 | func SharedDepTag() blueprint.DependencyTag { |
| 294 | return libraryDependencyTag{Kind: sharedLibraryDependency} |
Ivan Lozano | 183a321 | 2019-10-18 14:18:45 -0700 | [diff] [blame] | 295 | } |
| 296 | |
Chris Parsons | 3c27ca3 | 2020-11-20 12:42:07 -0500 | [diff] [blame] | 297 | // StaticDepTag returns the dependency tag for any C++ static libraries. |
Ivan Lozano | 63bb768 | 2021-03-23 15:53:44 -0400 | [diff] [blame] | 298 | func StaticDepTag(wholeStatic bool) blueprint.DependencyTag { |
| 299 | return libraryDependencyTag{Kind: staticLibraryDependency, wholeStatic: wholeStatic} |
| 300 | } |
| 301 | |
| 302 | // IsWholeStaticLib whether a dependency tag is a whole static library dependency. |
| 303 | func IsWholeStaticLib(depTag blueprint.DependencyTag) bool { |
| 304 | if tag, ok := depTag.(libraryDependencyTag); ok { |
| 305 | return tag.wholeStatic |
| 306 | } |
| 307 | return false |
Colin Cross | 6e511a9 | 2020-07-27 21:26:48 -0700 | [diff] [blame] | 308 | } |
Colin Cross | 0de8a1e | 2020-09-18 14:15:30 -0700 | [diff] [blame] | 309 | |
Chris Parsons | 3c27ca3 | 2020-11-20 12:42:07 -0500 | [diff] [blame] | 310 | // HeaderDepTag returns the dependency tag for any C++ "header-only" libraries. |
Zach Johnson | 3df4e63 | 2020-11-06 11:56:27 -0800 | [diff] [blame] | 311 | func HeaderDepTag() blueprint.DependencyTag { |
| 312 | return libraryDependencyTag{Kind: headerLibraryDependency} |
| 313 | } |
| 314 | |
Chris Parsons | 3c27ca3 | 2020-11-20 12:42:07 -0500 | [diff] [blame] | 315 | // SharedLibraryInfo is a provider to propagate information about a shared C++ library. |
Colin Cross | 0de8a1e | 2020-09-18 14:15:30 -0700 | [diff] [blame] | 316 | type SharedLibraryInfo struct { |
Liz Kammer | ef6dfea | 2021-06-08 15:37:09 -0400 | [diff] [blame] | 317 | SharedLibrary android.Path |
| 318 | Target android.Target |
Colin Cross | 0de8a1e | 2020-09-18 14:15:30 -0700 | [diff] [blame] | 319 | |
Colin Cross | b614cd4 | 2024-10-11 12:52:21 -0700 | [diff] [blame^] | 320 | TableOfContents android.OptionalPath |
| 321 | IsStubs bool |
| 322 | ImplementationDeps depset.DepSet[string] |
Colin Cross | 0de8a1e | 2020-09-18 14:15:30 -0700 | [diff] [blame] | 323 | |
Liz Kammer | ef6dfea | 2021-06-08 15:37:09 -0400 | [diff] [blame] | 324 | // should be obtained from static analogue |
Colin Cross | a14fb6a | 2024-10-23 16:57:06 -0700 | [diff] [blame] | 325 | TransitiveStaticLibrariesForOrdering depset.DepSet[android.Path] |
Colin Cross | 0de8a1e | 2020-09-18 14:15:30 -0700 | [diff] [blame] | 326 | } |
| 327 | |
Colin Cross | bc7d76c | 2023-12-12 16:39:03 -0800 | [diff] [blame] | 328 | var SharedLibraryInfoProvider = blueprint.NewProvider[SharedLibraryInfo]() |
Colin Cross | 0de8a1e | 2020-09-18 14:15:30 -0700 | [diff] [blame] | 329 | |
Chris Parsons | 3c27ca3 | 2020-11-20 12:42:07 -0500 | [diff] [blame] | 330 | // SharedStubLibrary is a struct containing information about a stub shared library. |
| 331 | // Stub libraries are used for cross-APEX dependencies; when a library is to depend on a shared |
| 332 | // library in another APEX, it must depend on the stub version of that library. |
| 333 | type SharedStubLibrary struct { |
| 334 | // The version of the stub (corresponding to the stable version of the shared library being |
| 335 | // stubbed). |
Colin Cross | 0de8a1e | 2020-09-18 14:15:30 -0700 | [diff] [blame] | 336 | Version string |
| 337 | SharedLibraryInfo SharedLibraryInfo |
| 338 | FlagExporterInfo FlagExporterInfo |
| 339 | } |
| 340 | |
Chris Parsons | 3c27ca3 | 2020-11-20 12:42:07 -0500 | [diff] [blame] | 341 | // SharedLibraryStubsInfo is a provider to propagate information about all shared library stubs |
| 342 | // which are dependencies of a library. |
| 343 | // Stub libraries are used for cross-APEX dependencies; when a library is to depend on a shared |
| 344 | // library in another APEX, it must depend on the stub version of that library. |
| 345 | type SharedLibraryStubsInfo struct { |
| 346 | SharedStubLibraries []SharedStubLibrary |
Colin Cross | 0de8a1e | 2020-09-18 14:15:30 -0700 | [diff] [blame] | 347 | |
Chris Parsons | 3c27ca3 | 2020-11-20 12:42:07 -0500 | [diff] [blame] | 348 | IsLLNDK bool |
| 349 | } |
| 350 | |
Colin Cross | bc7d76c | 2023-12-12 16:39:03 -0800 | [diff] [blame] | 351 | var SharedLibraryStubsProvider = blueprint.NewProvider[SharedLibraryStubsInfo]() |
Chris Parsons | 3c27ca3 | 2020-11-20 12:42:07 -0500 | [diff] [blame] | 352 | |
| 353 | // StaticLibraryInfo is a provider to propagate information about a static C++ library. |
Colin Cross | 0de8a1e | 2020-09-18 14:15:30 -0700 | [diff] [blame] | 354 | type StaticLibraryInfo struct { |
| 355 | StaticLibrary android.Path |
| 356 | Objects Objects |
| 357 | ReuseObjects Objects |
| 358 | |
Colin Cross | a2bcf2c | 2022-02-11 13:11:55 -0800 | [diff] [blame] | 359 | // A static library may contain prebuilt static libraries included with whole_static_libs |
| 360 | // that won't appear in Objects. They are transitively available in |
| 361 | // WholeStaticLibsFromPrebuilts. |
| 362 | WholeStaticLibsFromPrebuilts android.Paths |
| 363 | |
Colin Cross | 0de8a1e | 2020-09-18 14:15:30 -0700 | [diff] [blame] | 364 | // This isn't the actual transitive DepSet, shared library dependencies have been |
| 365 | // converted into static library analogues. It is only used to order the static |
| 366 | // library dependencies that were specified for the current module. |
Colin Cross | a14fb6a | 2024-10-23 16:57:06 -0700 | [diff] [blame] | 367 | TransitiveStaticLibrariesForOrdering depset.DepSet[android.Path] |
Colin Cross | 0de8a1e | 2020-09-18 14:15:30 -0700 | [diff] [blame] | 368 | } |
| 369 | |
Colin Cross | bc7d76c | 2023-12-12 16:39:03 -0800 | [diff] [blame] | 370 | var StaticLibraryInfoProvider = blueprint.NewProvider[StaticLibraryInfo]() |
Colin Cross | 0de8a1e | 2020-09-18 14:15:30 -0700 | [diff] [blame] | 371 | |
Colin Cross | 649d817 | 2020-12-10 12:30:21 -0800 | [diff] [blame] | 372 | // HeaderLibraryInfo is a marker provider that identifies a module as a header library. |
| 373 | type HeaderLibraryInfo struct { |
| 374 | } |
| 375 | |
| 376 | // HeaderLibraryInfoProvider is a marker provider that identifies a module as a header library. |
Colin Cross | bc7d76c | 2023-12-12 16:39:03 -0800 | [diff] [blame] | 377 | var HeaderLibraryInfoProvider = blueprint.NewProvider[HeaderLibraryInfo]() |
Colin Cross | 649d817 | 2020-12-10 12:30:21 -0800 | [diff] [blame] | 378 | |
Chris Parsons | 3c27ca3 | 2020-11-20 12:42:07 -0500 | [diff] [blame] | 379 | // FlagExporterInfo is a provider to propagate transitive library information |
| 380 | // pertaining to exported include paths and flags. |
Colin Cross | 0de8a1e | 2020-09-18 14:15:30 -0700 | [diff] [blame] | 381 | type FlagExporterInfo struct { |
Chris Parsons | 3c27ca3 | 2020-11-20 12:42:07 -0500 | [diff] [blame] | 382 | IncludeDirs android.Paths // Include directories to be included with -I |
| 383 | SystemIncludeDirs android.Paths // System include directories to be included with -isystem |
| 384 | Flags []string // Exported raw flags. |
Colin Cross | 0de8a1e | 2020-09-18 14:15:30 -0700 | [diff] [blame] | 385 | Deps android.Paths |
Ivan Lozano | 0a468a4 | 2024-05-13 21:03:34 -0400 | [diff] [blame] | 386 | RustRlibDeps []RustRlibDep |
Colin Cross | 0de8a1e | 2020-09-18 14:15:30 -0700 | [diff] [blame] | 387 | GeneratedHeaders android.Paths |
| 388 | } |
| 389 | |
Colin Cross | bc7d76c | 2023-12-12 16:39:03 -0800 | [diff] [blame] | 390 | var FlagExporterInfoProvider = blueprint.NewProvider[FlagExporterInfo]() |
Colin Cross | b614cd4 | 2024-10-11 12:52:21 -0700 | [diff] [blame^] | 391 | |
| 392 | var ImplementationDepInfoProvider = blueprint.NewProvider[*ImplementationDepInfo]() |
| 393 | |
| 394 | type ImplementationDepInfo struct { |
| 395 | ImplementationDeps depset.DepSet[android.Path] |
| 396 | } |