summaryrefslogtreecommitdiff
path: root/cc/androidmk.go
diff options
context:
space:
mode:
Diffstat (limited to 'cc/androidmk.go')
-rw-r--r--cc/androidmk.go33
1 files changed, 11 insertions, 22 deletions
diff --git a/cc/androidmk.go b/cc/androidmk.go
index 380b4e92f..d92fabc0d 100644
--- a/cc/androidmk.go
+++ b/cc/androidmk.go
@@ -33,7 +33,7 @@ var (
)
type AndroidMkContext interface {
- Name() string
+ BaseModuleName() string
Target() android.Target
subAndroidMk(*android.AndroidMkEntries, interface{})
Arch() android.Arch
@@ -83,6 +83,13 @@ func (c *Module) AndroidMkEntries() []android.AndroidMkEntries {
if len(c.Properties.Logtags) > 0 {
entries.AddStrings("LOCAL_LOGTAGS_FILES", c.Properties.Logtags...)
}
+ // Note: Pass the exact value of AndroidMkSystemSharedLibs to the Make
+ // world, even if it is an empty list. In the Make world,
+ // LOCAL_SYSTEM_SHARED_LIBRARIES defaults to "none", which is expanded
+ // to the default list of system shared libs by the build system.
+ // Soong computes the exact list of system shared libs, so we have to
+ // override the default value when the list of libs is actually empty.
+ entries.SetString("LOCAL_SYSTEM_SHARED_LIBRARIES", strings.Join(c.Properties.AndroidMkSystemSharedLibs, " "))
if len(c.Properties.AndroidMkSharedLibs) > 0 {
entries.AddStrings("LOCAL_SHARED_LIBRARIES", c.Properties.AndroidMkSharedLibs...)
}
@@ -149,24 +156,6 @@ func (c *Module) AndroidMkEntries() []android.AndroidMkEntries {
return []android.AndroidMkEntries{entries}
}
-func AndroidMkDataPaths(data []android.DataPath) []string {
- var testFiles []string
- for _, d := range data {
- rel := d.SrcPath.Rel()
- path := d.SrcPath.String()
- if !strings.HasSuffix(path, rel) {
- panic(fmt.Errorf("path %q does not end with %q", path, rel))
- }
- path = strings.TrimSuffix(path, rel)
- testFileString := path + ":" + rel
- if len(d.RelativeInstallPath) > 0 {
- testFileString += ":" + d.RelativeInstallPath
- }
- testFiles = append(testFiles, testFileString)
- }
- return testFiles
-}
-
func androidMkWriteExtraTestConfigs(extraTestConfigs android.Paths, entries *android.AndroidMkEntries) {
if len(extraTestConfigs) > 0 {
entries.ExtraEntries = append(entries.ExtraEntries, func(entries *android.AndroidMkEntries) {
@@ -176,7 +165,7 @@ func androidMkWriteExtraTestConfigs(extraTestConfigs android.Paths, entries *and
}
func androidMkWriteTestData(data []android.DataPath, ctx AndroidMkContext, entries *android.AndroidMkEntries) {
- testFiles := AndroidMkDataPaths(data)
+ testFiles := android.AndroidMkDataPaths(data)
if len(testFiles) > 0 {
entries.ExtraEntries = append(entries.ExtraEntries, func(entries *android.AndroidMkEntries) {
entries.AddStrings("LOCAL_TEST_DATA", testFiles...)
@@ -289,7 +278,7 @@ func (library *libraryDecorator) AndroidMkEntries(ctx AndroidMkContext, entries
})
}
if len(library.Properties.Stubs.Versions) > 0 &&
- android.DirectlyInAnyApex(ctx, ctx.Name()) && !ctx.InRamdisk() && !ctx.InRecovery() && !ctx.UseVndk() &&
+ android.DirectlyInAnyApex(ctx, ctx.BaseModuleName()) && !ctx.InRamdisk() && !ctx.InRecovery() && !ctx.UseVndk() &&
!ctx.static() {
if library.buildStubs() && library.isLatestStubVersion() {
// reference the latest version via its name without suffix when it is provided by apex
@@ -451,7 +440,7 @@ func (installer *baseInstaller) AndroidMkEntries(ctx AndroidMkContext, entries *
}
func (c *stubDecorator) AndroidMkEntries(ctx AndroidMkContext, entries *android.AndroidMkEntries) {
- entries.SubName = ndkLibrarySuffix + "." + c.properties.ApiLevel
+ entries.SubName = ndkLibrarySuffix + "." + c.apiLevel.String()
entries.Class = "SHARED_LIBRARIES"
entries.ExtraEntries = append(entries.ExtraEntries, func(entries *android.AndroidMkEntries) {