blob: 209939916bce83649b1889852cedc4547baedf82 [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"
Liz Kammerb6a55bf2021-04-12 15:42:51 -04005 "android/soong/bazel/cquery"
Ivan Lozano0f9963e2023-02-06 13:31:02 -05006 "android/soong/fuzz"
Kiyoung Kim48f37782021-07-07 12:42:39 +09007 "android/soong/snapshot"
Colin Cross6e511a92020-07-27 21:26:48 -07008
9 "github.com/google/blueprint"
Ivan Lozano183a3212019-10-18 14:18:45 -070010)
11
Ivan Lozano3968d8f2020-12-14 11:27:52 -050012// PlatformSanitizeable is an interface for sanitizing platform modules.
13type PlatformSanitizeable interface {
14 LinkableInterface
15
16 // SanitizePropDefined returns whether the Sanitizer properties struct for this module is defined.
17 SanitizePropDefined() bool
18
Ivan Lozano3968d8f2020-12-14 11:27:52 -050019 // IsSanitizerEnabled returns whether a sanitizer is enabled.
20 IsSanitizerEnabled(t SanitizerType) bool
21
22 // IsSanitizerExplicitlyDisabled returns whether a sanitizer has been explicitly disabled (set to false) rather
23 // than left undefined.
24 IsSanitizerExplicitlyDisabled(t SanitizerType) bool
25
Ivan Lozano3968d8f2020-12-14 11:27:52 -050026 // SetSanitizer enables or disables the specified sanitizer type if it's supported, otherwise this should panic.
27 SetSanitizer(t SanitizerType, b bool)
28
Ivan Lozano3968d8f2020-12-14 11:27:52 -050029 // StaticallyLinked returns true if the module is statically linked.
30 StaticallyLinked() bool
31
32 // SetInSanitizerDir sets the module installation to the sanitizer directory.
33 SetInSanitizerDir()
34
35 // SanitizeNever returns true if this module should never be sanitized.
36 SanitizeNever() bool
37
38 // SanitizerSupported returns true if a sanitizer type is supported by this modules compiler.
39 SanitizerSupported(t SanitizerType) bool
40
Ivan Lozanod7586b62021-04-01 09:49:36 -040041 // MinimalRuntimeDep returns true if this module needs to link the minimal UBSan runtime,
42 // either because it requires it or because a dependent module which requires it to be linked in this module.
43 MinimalRuntimeDep() bool
44
45 // UbsanRuntimeDep returns true if this module needs to link the full UBSan runtime,
46 // either because it requires it or because a dependent module which requires it to be linked in this module.
47 UbsanRuntimeDep() bool
48
49 // UbsanRuntimeNeeded returns true if the full UBSan runtime is required by this module.
50 UbsanRuntimeNeeded() bool
51
52 // MinimalRuntimeNeeded returns true if the minimal UBSan runtime is required by this module
53 MinimalRuntimeNeeded() bool
54
Ivan Lozano3968d8f2020-12-14 11:27:52 -050055 // SanitizableDepTagChecker returns a SantizableDependencyTagChecker function type.
56 SanitizableDepTagChecker() SantizableDependencyTagChecker
57}
58
59// SantizableDependencyTagChecker functions check whether or not a dependency
60// tag can be sanitized. These functions should return true if the tag can be
61// sanitized, otherwise they should return false. These functions should also
62// handle all possible dependency tags in the dependency tree. For example,
63// Rust modules can depend on both Rust and CC libraries, so the Rust module
64// implementation should handle tags from both.
65type SantizableDependencyTagChecker func(tag blueprint.DependencyTag) bool
66
Ivan Lozanod7586b62021-04-01 09:49:36 -040067// Snapshottable defines those functions necessary for handling module snapshots.
68type Snapshottable interface {
Kiyoung Kim48f37782021-07-07 12:42:39 +090069 snapshot.VendorSnapshotModuleInterface
70 snapshot.RecoverySnapshotModuleInterface
71
Ivan Lozanod7586b62021-04-01 09:49:36 -040072 // SnapshotHeaders returns a list of header paths provided by this module.
73 SnapshotHeaders() android.Paths
74
Ivan Lozanod7586b62021-04-01 09:49:36 -040075 // SnapshotLibrary returns true if this module is a snapshot library.
76 IsSnapshotLibrary() bool
77
Justin Yun885a7de2021-06-29 20:34:53 +090078 // EffectiveLicenseFiles returns the list of License files for this module.
79 EffectiveLicenseFiles() android.Paths
80
Ivan Lozanod7586b62021-04-01 09:49:36 -040081 // SnapshotRuntimeLibs returns a list of libraries needed by this module at runtime but which aren't build dependencies.
82 SnapshotRuntimeLibs() []string
83
84 // SnapshotSharedLibs returns the list of shared library dependencies for this module.
85 SnapshotSharedLibs() []string
86
Justin Yun5e035862021-06-29 20:50:37 +090087 // SnapshotStaticLibs returns the list of static library dependencies for this module.
88 SnapshotStaticLibs() []string
89
Ivan Lozanoadd122a2023-07-13 11:01:41 -040090 // SnapshotDylibs returns the list of dylib library dependencies for this module.
91 SnapshotDylibs() []string
92
93 // SnapshotRlibs returns the list of rlib library dependencies for this module.
94 SnapshotRlibs() []string
95
Ivan Lozanod7586b62021-04-01 09:49:36 -040096 // IsSnapshotPrebuilt returns true if this module is a snapshot prebuilt.
97 IsSnapshotPrebuilt() bool
98}
99
Chris Parsons3c27ca32020-11-20 12:42:07 -0500100// LinkableInterface is an interface for a type of module that is linkable in a C++ library.
Ivan Lozano183a3212019-10-18 14:18:45 -0700101type LinkableInterface interface {
Ivan Lozanof9e21722020-12-02 09:00:51 -0500102 android.Module
Ivan Lozanod7586b62021-04-01 09:49:36 -0400103 Snapshottable
Ivan Lozanof9e21722020-12-02 09:00:51 -0500104
Ivan Lozano183a3212019-10-18 14:18:45 -0700105 Module() android.Module
106 CcLibrary() bool
107 CcLibraryInterface() bool
108
Ivan Lozano61c02cc2023-06-09 14:06:44 -0400109 // RustLibraryInterface returns true if this is a Rust library module
110 RustLibraryInterface() bool
111
Ivan Lozanod7586b62021-04-01 09:49:36 -0400112 // BaseModuleName returns the android.ModuleBase.BaseModuleName() value for this module.
113 BaseModuleName() string
114
Ivan Lozano183a3212019-10-18 14:18:45 -0700115 OutputFile() android.OptionalPath
Ivan Lozano39b0bf02021-10-14 12:22:09 -0400116 UnstrippedOutputFile() android.Path
Ivan Lozanoa0cd8f92020-04-09 09:56:02 -0400117 CoverageFiles() android.Paths
Ivan Lozano183a3212019-10-18 14:18:45 -0700118
Ivan Lozano7f67c2a2022-06-27 16:00:26 -0400119 // CoverageOutputFile returns the output archive of gcno coverage information files.
120 CoverageOutputFile() android.OptionalPath
121
Ivan Lozano2b262972019-11-21 12:30:50 -0800122 NonCcVariants() bool
123
Ivan Lozano52767be2019-10-18 14:49:46 -0700124 SelectedStl() string
Ivan Lozano183a3212019-10-18 14:18:45 -0700125
126 BuildStaticVariant() bool
127 BuildSharedVariant() bool
128 SetStatic()
129 SetShared()
Ivan Lozano3968d8f2020-12-14 11:27:52 -0500130 IsPrebuilt() bool
Ivan Lozano52767be2019-10-18 14:49:46 -0700131 Toc() android.OptionalPath
132
Ivan Lozano0f9963e2023-02-06 13:31:02 -0500133 // IsFuzzModule returns true if this a *_fuzz module.
134 IsFuzzModule() bool
135
136 // FuzzPackagedModule returns the fuzz.FuzzPackagedModule for this module.
137 // Expects that IsFuzzModule returns true.
138 FuzzPackagedModule() fuzz.FuzzPackagedModule
139
140 // FuzzSharedLibraries returns the shared library dependencies for this module.
141 // Expects that IsFuzzModule returns true.
Hamzeh Zawawy38917492023-04-05 22:08:46 +0000142 FuzzSharedLibraries() android.RuleBuilderInstalls
Ivan Lozano0f9963e2023-02-06 13:31:02 -0500143
Yi-Yo Chiang36d8e4e2021-07-02 21:21:13 +0800144 Device() bool
Jooyung Han624d35c2020-04-10 12:57:24 +0900145 Host() bool
146
Yifan Hong1b3348d2020-01-21 15:53:22 -0800147 InRamdisk() bool
148 OnlyInRamdisk() bool
149
Yifan Hong60e0cfb2020-10-21 15:17:56 -0700150 InVendorRamdisk() bool
151 OnlyInVendorRamdisk() bool
152
Ivan Lozano52767be2019-10-18 14:49:46 -0700153 InRecovery() bool
154 OnlyInRecovery() bool
155
Ivan Lozano3968d8f2020-12-14 11:27:52 -0500156 InVendor() bool
157
Colin Crossc511bc52020-04-07 16:50:32 +0000158 UseSdk() bool
Ivan Lozano3a7d0002021-03-30 12:19:36 -0400159
Ivan Lozano7f67c2a2022-06-27 16:00:26 -0400160 // IsNdk returns true if the library is in the configs known NDK list.
161 IsNdk(config android.Config) bool
162
163 // IsStubs returns true if the this is a stubs library.
164 IsStubs() bool
165
Ivan Lozano3a7d0002021-03-30 12:19:36 -0400166 // IsLlndk returns true for both LLNDK (public) and LLNDK-private libs.
167 IsLlndk() bool
168
169 // IsLlndkPublic returns true only for LLNDK (public) libs.
170 IsLlndkPublic() bool
171
Ivan Lozanod7586b62021-04-01 09:49:36 -0400172 // HasLlndkStubs returns true if this library has a variant that will build LLNDK stubs.
173 HasLlndkStubs() bool
174
Colin Cross1f3f1302021-04-26 18:37:44 -0700175 // NeedsLlndkVariants returns true if this module has LLNDK stubs or provides LLNDK headers.
176 NeedsLlndkVariants() bool
Ivan Lozano3a7d0002021-03-30 12:19:36 -0400177
Colin Cross5271fea2021-04-27 13:06:04 -0700178 // NeedsVendorPublicLibraryVariants returns true if this module has vendor public library stubs.
179 NeedsVendorPublicLibraryVariants() bool
180
Ivan Lozanod7586b62021-04-01 09:49:36 -0400181 //StubsVersion returns the stubs version for this module.
182 StubsVersion() string
183
184 // UseVndk returns true if the module is using VNDK libraries instead of the libraries in /system/lib or /system/lib64.
185 // "product" and "vendor" variant modules return true for this function.
186 // When BOARD_VNDK_VERSION is set, vendor variants of "vendor_available: true", "vendor: true",
187 // "soc_specific: true" and more vendor installed modules are included here.
188 // When PRODUCT_PRODUCT_VNDK_VERSION is set, product variants of "vendor_available: true" or
189 // "product_specific: true" modules are included here.
Ivan Lozano52767be2019-10-18 14:49:46 -0700190 UseVndk() bool
Ivan Lozanod7586b62021-04-01 09:49:36 -0400191
Jiyong Park7d55b612021-06-11 17:22:09 +0900192 // Bootstrap tests if this module is allowed to use non-APEX version of libraries.
193 Bootstrap() bool
194
Ivan Lozanod7586b62021-04-01 09:49:36 -0400195 // IsVndkSp returns true if this is a VNDK-SP module.
196 IsVndkSp() bool
197
Ivan Lozano52767be2019-10-18 14:49:46 -0700198 MustUseVendorVariant() bool
199 IsVndk() bool
Ivan Lozanof9e21722020-12-02 09:00:51 -0500200 IsVndkExt() bool
Colin Cross127bb8b2020-12-16 16:46:01 -0800201 IsVndkPrivate() bool
Ivan Lozanof1868af2022-04-12 13:08:36 -0400202 IsVendorPublicLibrary() bool
203 IsVndkPrebuiltLibrary() bool
Ivan Lozano52767be2019-10-18 14:49:46 -0700204 HasVendorVariant() bool
Justin Yuncbca3732021-02-03 19:24:13 +0900205 HasProductVariant() bool
206 HasNonSystemVariants() bool
Ivan Lozanof1868af2022-04-12 13:08:36 -0400207 ProductSpecific() bool
Ivan Lozanof9e21722020-12-02 09:00:51 -0500208 InProduct() bool
Ivan Lozanof1868af2022-04-12 13:08:36 -0400209 SdkAndPlatformVariantVisibleToMake() bool
Ivan Lozano52767be2019-10-18 14:49:46 -0700210
Ivan Lozanoc08897c2021-04-02 12:41:32 -0400211 // SubName returns the modules SubName, used for image and NDK/SDK variations.
212 SubName() string
213
Ivan Lozano52767be2019-10-18 14:49:46 -0700214 SdkVersion() string
Jiyong Parkfdaa5f72021-03-19 22:18:04 +0900215 MinSdkVersion() string
Colin Crossc511bc52020-04-07 16:50:32 +0000216 AlwaysSdk() bool
Jiyong Park2286afd2020-06-16 21:58:53 +0900217 IsSdkVariant() bool
Ivan Lozano52767be2019-10-18 14:49:46 -0700218
Colin Cross1348ce32020-10-01 13:37:16 -0700219 SplitPerApiLevel() bool
Ivan Lozano3968d8f2020-12-14 11:27:52 -0500220
221 // SetPreventInstall sets the PreventInstall property to 'true' for this module.
222 SetPreventInstall()
223 // SetHideFromMake sets the HideFromMake property to 'true' for this module.
224 SetHideFromMake()
Ivan Lozano3a7d0002021-03-30 12:19:36 -0400225
226 // KernelHeadersDecorator returns true if this is a kernel headers decorator module.
227 // This is specific to cc and should always return false for all other packages.
228 KernelHeadersDecorator() bool
Ivan Lozanod7586b62021-04-01 09:49:36 -0400229
230 // HiddenFromMake returns true if this module is hidden from Make.
231 HiddenFromMake() bool
232
233 // RelativeInstallPath returns the relative install path for this module.
234 RelativeInstallPath() string
235
236 // Binary returns true if this is a binary module.
237 Binary() bool
238
239 // Object returns true if this is an object module.
240 Object() bool
241
242 // Rlib returns true if this is an rlib module.
243 Rlib() bool
244
245 // Dylib returns true if this is an dylib module.
246 Dylib() bool
247
Ivan Lozanoadd122a2023-07-13 11:01:41 -0400248 // RlibStd returns true if this is an rlib which links against an rlib libstd.
249 RlibStd() bool
250
Ivan Lozanod7586b62021-04-01 09:49:36 -0400251 // Static returns true if this is a static library module.
252 Static() bool
253
254 // Shared returns true if this is a shared library module.
255 Shared() bool
256
257 // Header returns true if this is a library headers module.
258 Header() bool
259
Justin Yun5e035862021-06-29 20:50:37 +0900260 // StaticExecutable returns true if this is a binary module with "static_executable: true".
261 StaticExecutable() bool
262
Ivan Lozanod7586b62021-04-01 09:49:36 -0400263 // EverInstallable returns true if the module is ever installable
264 EverInstallable() bool
265
266 // PreventInstall returns true if this module is prevented from installation.
267 PreventInstall() bool
268
269 // InstallInData returns true if this module is installed in data.
270 InstallInData() bool
271
272 // Installable returns a bool pointer to the module installable property.
273 Installable() *bool
274
275 // Symlinks returns a list of symlinks that should be created for this module.
276 Symlinks() []string
277
278 // VndkVersion returns the VNDK version string for this module.
279 VndkVersion() string
Jihoon Kangf78a8902022-09-01 22:47:07 +0000280
281 // Partition returns the partition string for this module.
282 Partition() string
Ivan Lozano0f9963e2023-02-06 13:31:02 -0500283
284 // FuzzModule returns the fuzz.FuzzModule associated with the module.
285 FuzzModuleStruct() fuzz.FuzzModule
Ivan Lozano183a3212019-10-18 14:18:45 -0700286}
287
Colin Cross6e511a92020-07-27 21:26:48 -0700288var (
Chris Parsons3c27ca32020-11-20 12:42:07 -0500289 // Dependency tag for crtbegin, an object file responsible for initialization.
Colin Cross6e511a92020-07-27 21:26:48 -0700290 CrtBeginDepTag = dependencyTag{name: "crtbegin"}
Chris Parsons3c27ca32020-11-20 12:42:07 -0500291 // Dependency tag for crtend, an object file responsible for program termination.
292 CrtEndDepTag = dependencyTag{name: "crtend"}
293 // Dependency tag for coverage library.
Colin Cross6e511a92020-07-27 21:26:48 -0700294 CoverageDepTag = dependencyTag{name: "coverage"}
295)
Ivan Lozano183a3212019-10-18 14:18:45 -0700296
Ivan Lozano3968d8f2020-12-14 11:27:52 -0500297// GetImageVariantType returns the ImageVariantType string value for the given module
298// (these are defined in cc/image.go).
299func GetImageVariantType(c LinkableInterface) ImageVariantType {
300 if c.Host() {
301 return hostImageVariant
302 } else if c.InVendor() {
303 return vendorImageVariant
304 } else if c.InProduct() {
305 return productImageVariant
306 } else if c.InRamdisk() {
307 return ramdiskImageVariant
308 } else if c.InVendorRamdisk() {
309 return vendorRamdiskImageVariant
310 } else if c.InRecovery() {
311 return recoveryImageVariant
312 } else {
313 return coreImageVariant
314 }
315}
316
Ivan Lozanoc08897c2021-04-02 12:41:32 -0400317// DepTagMakeSuffix returns the makeSuffix value of a particular library dependency tag.
318// Returns an empty string if not a library dependency tag.
319func DepTagMakeSuffix(depTag blueprint.DependencyTag) string {
320 if libDepTag, ok := depTag.(libraryDependencyTag); ok {
321 return libDepTag.makeSuffix
322 }
323 return ""
324}
325
Chris Parsons3c27ca32020-11-20 12:42:07 -0500326// SharedDepTag returns the dependency tag for any C++ shared libraries.
Colin Cross6e511a92020-07-27 21:26:48 -0700327func SharedDepTag() blueprint.DependencyTag {
328 return libraryDependencyTag{Kind: sharedLibraryDependency}
Ivan Lozano183a3212019-10-18 14:18:45 -0700329}
330
Chris Parsons3c27ca32020-11-20 12:42:07 -0500331// StaticDepTag returns the dependency tag for any C++ static libraries.
Ivan Lozano63bb7682021-03-23 15:53:44 -0400332func StaticDepTag(wholeStatic bool) blueprint.DependencyTag {
333 return libraryDependencyTag{Kind: staticLibraryDependency, wholeStatic: wholeStatic}
334}
335
336// IsWholeStaticLib whether a dependency tag is a whole static library dependency.
337func IsWholeStaticLib(depTag blueprint.DependencyTag) bool {
338 if tag, ok := depTag.(libraryDependencyTag); ok {
339 return tag.wholeStatic
340 }
341 return false
Colin Cross6e511a92020-07-27 21:26:48 -0700342}
Colin Cross0de8a1e2020-09-18 14:15:30 -0700343
Chris Parsons3c27ca32020-11-20 12:42:07 -0500344// HeaderDepTag returns the dependency tag for any C++ "header-only" libraries.
Zach Johnson3df4e632020-11-06 11:56:27 -0800345func HeaderDepTag() blueprint.DependencyTag {
346 return libraryDependencyTag{Kind: headerLibraryDependency}
347}
348
Chris Parsons3c27ca32020-11-20 12:42:07 -0500349// SharedLibraryInfo is a provider to propagate information about a shared C++ library.
Colin Cross0de8a1e2020-09-18 14:15:30 -0700350type SharedLibraryInfo struct {
Liz Kammeref6dfea2021-06-08 15:37:09 -0400351 SharedLibrary android.Path
352 Target android.Target
Colin Cross0de8a1e2020-09-18 14:15:30 -0700353
Liz Kammeref6dfea2021-06-08 15:37:09 -0400354 TableOfContents android.OptionalPath
Colin Cross0de8a1e2020-09-18 14:15:30 -0700355
Liz Kammeref6dfea2021-06-08 15:37:09 -0400356 // should be obtained from static analogue
Colin Crossc85750b2022-04-21 12:50:51 -0700357 TransitiveStaticLibrariesForOrdering *android.DepSet[android.Path]
Colin Cross0de8a1e2020-09-18 14:15:30 -0700358}
359
360var SharedLibraryInfoProvider = blueprint.NewProvider(SharedLibraryInfo{})
361
Chris Parsons3c27ca32020-11-20 12:42:07 -0500362// SharedStubLibrary is a struct containing information about a stub shared library.
363// Stub libraries are used for cross-APEX dependencies; when a library is to depend on a shared
364// library in another APEX, it must depend on the stub version of that library.
365type SharedStubLibrary struct {
366 // The version of the stub (corresponding to the stable version of the shared library being
367 // stubbed).
Colin Cross0de8a1e2020-09-18 14:15:30 -0700368 Version string
369 SharedLibraryInfo SharedLibraryInfo
370 FlagExporterInfo FlagExporterInfo
371}
372
Chris Parsons3c27ca32020-11-20 12:42:07 -0500373// SharedLibraryStubsInfo is a provider to propagate information about all shared library stubs
374// which are dependencies of a library.
375// Stub libraries are used for cross-APEX dependencies; when a library is to depend on a shared
376// library in another APEX, it must depend on the stub version of that library.
377type SharedLibraryStubsInfo struct {
378 SharedStubLibraries []SharedStubLibrary
Colin Cross0de8a1e2020-09-18 14:15:30 -0700379
Chris Parsons3c27ca32020-11-20 12:42:07 -0500380 IsLLNDK bool
381}
382
383var SharedLibraryStubsProvider = blueprint.NewProvider(SharedLibraryStubsInfo{})
384
385// StaticLibraryInfo is a provider to propagate information about a static C++ library.
Colin Cross0de8a1e2020-09-18 14:15:30 -0700386type StaticLibraryInfo struct {
387 StaticLibrary android.Path
388 Objects Objects
389 ReuseObjects Objects
390
Colin Crossa2bcf2c2022-02-11 13:11:55 -0800391 // A static library may contain prebuilt static libraries included with whole_static_libs
392 // that won't appear in Objects. They are transitively available in
393 // WholeStaticLibsFromPrebuilts.
394 WholeStaticLibsFromPrebuilts android.Paths
395
Colin Cross0de8a1e2020-09-18 14:15:30 -0700396 // This isn't the actual transitive DepSet, shared library dependencies have been
397 // converted into static library analogues. It is only used to order the static
398 // library dependencies that were specified for the current module.
Colin Crossc85750b2022-04-21 12:50:51 -0700399 TransitiveStaticLibrariesForOrdering *android.DepSet[android.Path]
Colin Cross0de8a1e2020-09-18 14:15:30 -0700400}
401
402var StaticLibraryInfoProvider = blueprint.NewProvider(StaticLibraryInfo{})
403
Colin Cross649d8172020-12-10 12:30:21 -0800404// HeaderLibraryInfo is a marker provider that identifies a module as a header library.
405type HeaderLibraryInfo struct {
406}
407
408// HeaderLibraryInfoProvider is a marker provider that identifies a module as a header library.
409var HeaderLibraryInfoProvider = blueprint.NewProvider(HeaderLibraryInfo{})
410
Chris Parsons3c27ca32020-11-20 12:42:07 -0500411// FlagExporterInfo is a provider to propagate transitive library information
412// pertaining to exported include paths and flags.
Colin Cross0de8a1e2020-09-18 14:15:30 -0700413type FlagExporterInfo struct {
Chris Parsons3c27ca32020-11-20 12:42:07 -0500414 IncludeDirs android.Paths // Include directories to be included with -I
415 SystemIncludeDirs android.Paths // System include directories to be included with -isystem
416 Flags []string // Exported raw flags.
Colin Cross0de8a1e2020-09-18 14:15:30 -0700417 Deps android.Paths
418 GeneratedHeaders android.Paths
419}
420
421var FlagExporterInfoProvider = blueprint.NewProvider(FlagExporterInfo{})
Liz Kammerb6a55bf2021-04-12 15:42:51 -0400422
423// flagExporterInfoFromCcInfo populates FlagExporterInfo provider with information from Bazel.
424func flagExporterInfoFromCcInfo(ctx android.ModuleContext, ccInfo cquery.CcInfo) FlagExporterInfo {
425
426 includes := android.PathsForBazelOut(ctx, ccInfo.Includes)
427 systemIncludes := android.PathsForBazelOut(ctx, ccInfo.SystemIncludes)
Liz Kammereb2d6d12021-12-06 14:56:25 -0500428 headers := android.PathsForBazelOut(ctx, ccInfo.Headers)
Liz Kammerb6a55bf2021-04-12 15:42:51 -0400429
430 return FlagExporterInfo{
Chris Parsonsf60ecf02021-04-27 14:48:30 -0400431 IncludeDirs: android.FirstUniquePaths(includes),
432 SystemIncludeDirs: android.FirstUniquePaths(systemIncludes),
Liz Kammereb2d6d12021-12-06 14:56:25 -0500433 GeneratedHeaders: headers,
434 // necessary to ensure generated headers are considered implicit deps of dependent actions
435 Deps: headers,
Liz Kammerb6a55bf2021-04-12 15:42:51 -0400436 }
437}