diff options
Diffstat (limited to 'rust/library.go')
-rw-r--r-- | rust/library.go | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/rust/library.go b/rust/library.go index 3560d73ed..6be4917bf 100644 --- a/rust/library.go +++ b/rust/library.go @@ -104,8 +104,6 @@ type libraryDecorator struct { includeDirs android.Paths sourceProvider SourceProvider - collectedSnapshotHeaders android.Paths - // table-of-contents file for cdylib crates to optimize out relinking when possible tocFile android.OptionalPath } @@ -749,55 +747,3 @@ func LibstdMutator(mctx android.BottomUpMutatorContext) { } } } - -func (l *libraryDecorator) snapshotHeaders() android.Paths { - if l.collectedSnapshotHeaders == nil { - panic("snapshotHeaders() must be called after collectHeadersForSnapshot()") - } - return l.collectedSnapshotHeaders -} - -// collectHeadersForSnapshot collects all exported headers from library. -// It globs header files in the source tree for exported include directories, -// and tracks generated header files separately. -// -// This is to be called from GenerateAndroidBuildActions, and then collected -// header files can be retrieved by snapshotHeaders(). -func (l *libraryDecorator) collectHeadersForSnapshot(ctx android.ModuleContext, deps PathDeps) { - ret := android.Paths{} - - // Glob together the headers from the modules include_dirs property - for _, path := range android.CopyOfPaths(l.includeDirs) { - dir := path.String() - globDir := dir + "/**/*" - glob, err := ctx.GlobWithDeps(globDir, nil) - if err != nil { - ctx.ModuleErrorf("glob of %q failed: %s", globDir, err) - return - } - - for _, header := range glob { - // Filter out only the files with extensions that are headers. - found := false - for _, ext := range cc.HeaderExts { - if strings.HasSuffix(header, ext) { - found = true - break - } - } - if !found { - continue - } - ret = append(ret, android.PathForSource(ctx, header)) - } - } - - // Glob together the headers from C dependencies as well, starting with non-generated headers. - ret = append(ret, cc.GlobHeadersForSnapshot(ctx, append(android.CopyOfPaths(deps.depIncludePaths), deps.depSystemIncludePaths...))...) - - // Collect generated headers from C dependencies. - ret = append(ret, cc.GlobGeneratedHeadersForSnapshot(ctx, deps.depGeneratedHeaders)...) - - // TODO(185577950): If support for generated headers is added, they need to be collected here as well. - l.collectedSnapshotHeaders = ret -} |