diff options
Diffstat (limited to 'cc/snapshot_utils.go')
-rw-r--r-- | cc/snapshot_utils.go | 52 |
1 files changed, 8 insertions, 44 deletions
diff --git a/cc/snapshot_utils.go b/cc/snapshot_utils.go index 73388ceb6..4012def52 100644 --- a/cc/snapshot_utils.go +++ b/cc/snapshot_utils.go @@ -14,8 +14,6 @@ package cc import ( - "strings" - "android/soong/android" ) @@ -26,6 +24,8 @@ var ( type snapshotLibraryInterface interface { exportedFlagsProducer libraryInterface + collectHeadersForSnapshot(ctx android.ModuleContext) + snapshotHeaders() android.Paths } var _ snapshotLibraryInterface = (*prebuiltLibraryLinker)(nil) @@ -58,49 +58,13 @@ func (s *snapshotMap) get(name string, arch android.ArchType) (snapshot string, return snapshot, found } -func exportedHeaders(ctx android.SingletonContext, l exportedFlagsProducer) android.Paths { - var ret android.Paths - - // Headers in the source tree should be globbed. On the contrast, generated headers - // can't be globbed, and they should be manually collected. - // So, we first filter out intermediate directories (which contains generated headers) - // from exported directories, and then glob headers under remaining directories. - for _, path := range append(l.exportedDirs(), l.exportedSystemDirs()...) { - dir := path.String() - // Skip if dir is for generated headers - if strings.HasPrefix(dir, android.PathForOutput(ctx).String()) { - continue - } - exts := headerExts - // Glob all files under this special directory, because of C++ headers. - if strings.HasPrefix(dir, "external/libcxx/include") { - exts = []string{""} - } - for _, ext := range exts { - glob, err := ctx.GlobWithDeps(dir+"/**/*"+ext, nil) - if err != nil { - ctx.Errorf("%#v\n", err) - return nil - } - for _, header := range glob { - if strings.HasSuffix(header, "/") { - continue - } - ret = append(ret, android.PathForSource(ctx, header)) - } - } +func isSnapshotAware(ctx android.ModuleContext, m *Module) bool { + if _, _, ok := isVndkSnapshotLibrary(ctx.DeviceConfig(), m); ok { + return ctx.Config().VndkSnapshotBuildArtifacts() + } else if isVendorSnapshotModule(m, ctx.ModuleDir()) { + return true } - - // Collect generated headers - for _, header := range append(l.exportedGeneratedHeaders(), l.exportedDeps()...) { - // TODO(b/148123511): remove exportedDeps after cleaning up genrule - if strings.HasSuffix(header.Base(), "-phony") { - continue - } - ret = append(ret, header) - } - - return ret + return false } func copyFile(ctx android.SingletonContext, path android.Path, out string) android.OutputPath { |