summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Colin Cross <ccross@android.com> 2020-12-15 18:40:55 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2020-12-15 18:40:55 +0000
commit01a44004fddc67fd0e1135009ba8a8f95f58164a (patch)
treebc27e9a351bb4513b7a9d7dfa94410dc0efdadf9
parenta76719695566e69629b7f20a2fdf6f1389443243 (diff)
parent3f2fa9b846977eec7276fb768ad6e7be3836b527 (diff)
Merge changes from topic "header_libs_requirement"
* changes: Add libstagefright_mp3dec_headers to allowed apex deps Require libraries in header_libs to be cc_library_header
-rw-r--r--apex/allowed_deps.txt1
-rw-r--r--cc/cc.go9
-rw-r--r--cc/library.go26
-rw-r--r--cc/linkable.go7
-rw-r--r--cc/prebuilt.go6
5 files changed, 38 insertions, 11 deletions
diff --git a/apex/allowed_deps.txt b/apex/allowed_deps.txt
index 3c9791f4d..c5f2bf879 100644
--- a/apex/allowed_deps.txt
+++ b/apex/allowed_deps.txt
@@ -407,6 +407,7 @@ libstagefright_m4vh263dec(minSdkVersion:29)
libstagefright_m4vh263enc(minSdkVersion:29)
libstagefright_metadatautils(minSdkVersion:29)
libstagefright_mp3dec(minSdkVersion:29)
+libstagefright_mp3dec_headers(minSdkVersion:29)
libstagefright_mpeg2extractor(minSdkVersion:29)
libstagefright_mpeg2support_nocrypto(minSdkVersion:29)
libstats_jni(minSdkVersion:(no version))
diff --git a/cc/cc.go b/cc/cc.go
index 7a94f89ce..89f32f163 100644
--- a/cc/cc.go
+++ b/cc/cc.go
@@ -2411,7 +2411,14 @@ func (c *Module) depsToPaths(ctx android.ModuleContext) PathDeps {
switch {
case libDepTag.header():
- // nothing
+ if !ctx.OtherModuleHasProvider(dep, HeaderLibraryInfoProvider) {
+ if !ctx.Config().AllowMissingDependencies() {
+ ctx.ModuleErrorf("module %q is not a header library", depName)
+ } else {
+ ctx.AddMissingDependencies([]string{depName})
+ }
+ return
+ }
case libDepTag.shared():
if !ctx.OtherModuleHasProvider(dep, SharedLibraryInfoProvider) {
if !ctx.Config().AllowMissingDependencies() {
diff --git a/cc/library.go b/cc/library.go
index ed6755f3c..01fcb7482 100644
--- a/cc/library.go
+++ b/cc/library.go
@@ -897,16 +897,22 @@ func (library *libraryDecorator) linkStatic(ctx ModuleContext,
ctx.CheckbuildFile(outputFile)
- ctx.SetProvider(StaticLibraryInfoProvider, StaticLibraryInfo{
- StaticLibrary: outputFile,
- ReuseObjects: library.reuseObjects,
- Objects: library.objects,
-
- TransitiveStaticLibrariesForOrdering: android.NewDepSetBuilder(android.TOPOLOGICAL).
- Direct(outputFile).
- Transitive(deps.TranstiveStaticLibrariesForOrdering).
- Build(),
- })
+ if library.static() {
+ ctx.SetProvider(StaticLibraryInfoProvider, StaticLibraryInfo{
+ StaticLibrary: outputFile,
+ ReuseObjects: library.reuseObjects,
+ Objects: library.objects,
+
+ TransitiveStaticLibrariesForOrdering: android.NewDepSetBuilder(android.TOPOLOGICAL).
+ Direct(outputFile).
+ Transitive(deps.TranstiveStaticLibrariesForOrdering).
+ Build(),
+ })
+ }
+
+ if library.header() {
+ ctx.SetProvider(HeaderLibraryInfoProvider, HeaderLibraryInfo{})
+ }
return outputFile
}
diff --git a/cc/linkable.go b/cc/linkable.go
index 4efe2a765..d0109856a 100644
--- a/cc/linkable.go
+++ b/cc/linkable.go
@@ -130,6 +130,13 @@ type StaticLibraryInfo struct {
var StaticLibraryInfoProvider = blueprint.NewProvider(StaticLibraryInfo{})
+// HeaderLibraryInfo is a marker provider that identifies a module as a header library.
+type HeaderLibraryInfo struct {
+}
+
+// HeaderLibraryInfoProvider is a marker provider that identifies a module as a header library.
+var HeaderLibraryInfoProvider = blueprint.NewProvider(HeaderLibraryInfo{})
+
// FlagExporterInfo is a provider to propagate transitive library information
// pertaining to exported include paths and flags.
type FlagExporterInfo struct {
diff --git a/cc/prebuilt.go b/cc/prebuilt.go
index 37df4ba0f..df713409d 100644
--- a/cc/prebuilt.go
+++ b/cc/prebuilt.go
@@ -190,6 +190,12 @@ func (p *prebuiltLibraryLinker) link(ctx ModuleContext,
}
}
+ if p.header() {
+ ctx.SetProvider(HeaderLibraryInfoProvider, HeaderLibraryInfo{})
+
+ return nil
+ }
+
return nil
}