Loading apex/apex_test.go +10 −1 Original line number Diff line number Diff line Loading @@ -802,7 +802,6 @@ func TestApexWithRuntimeLibsDependency(t *testing.T) { stubs: { versions: ["10", "20", "30"], }, apex_available: [ "myapex" ], } cc_library { Loading Loading @@ -3152,6 +3151,7 @@ func TestApexAvailable(t *testing.T) { name: "libfoo", stl: "none", system_shared_libs: [], runtime_libs: ["libbaz"], apex_available: ["myapex"], } Loading @@ -3160,6 +3160,15 @@ func TestApexAvailable(t *testing.T) { stl: "none", system_shared_libs: [], apex_available: ["//apex_available:anyapex"], } cc_library { name: "libbaz", stl: "none", system_shared_libs: [], stubs: { versions: ["10", "20", "30"], }, }`) // check that libfoo and libbar are created only for myapex, but not for the platform Loading cc/cc.go +9 −3 Original line number Diff line number Diff line Loading @@ -2638,10 +2638,16 @@ func (c *Module) AndroidMkWriteAdditionalDependenciesForSourceAbiDiff(w io.Write func (c *Module) DepIsInSameApex(ctx android.BaseModuleContext, dep android.Module) bool { if depTag, ok := ctx.OtherModuleDependencyTag(dep).(DependencyTag); ok { if cc, ok := dep.(*Module); ok { if cc.HasStubsVariants() && depTag.Shared && depTag.Library { if cc.HasStubsVariants() { if depTag.Shared && depTag.Library { // dynamic dep to a stubs lib crosses APEX boundary return false } if IsRuntimeDepTag(depTag) { // runtime dep to a stubs lib also crosses APEX boundary return false } } if depTag.FromStatic { // shared_lib dependency from a static lib is considered as crossing // the APEX boundary because the dependency doesn't actually is Loading Loading
apex/apex_test.go +10 −1 Original line number Diff line number Diff line Loading @@ -802,7 +802,6 @@ func TestApexWithRuntimeLibsDependency(t *testing.T) { stubs: { versions: ["10", "20", "30"], }, apex_available: [ "myapex" ], } cc_library { Loading Loading @@ -3152,6 +3151,7 @@ func TestApexAvailable(t *testing.T) { name: "libfoo", stl: "none", system_shared_libs: [], runtime_libs: ["libbaz"], apex_available: ["myapex"], } Loading @@ -3160,6 +3160,15 @@ func TestApexAvailable(t *testing.T) { stl: "none", system_shared_libs: [], apex_available: ["//apex_available:anyapex"], } cc_library { name: "libbaz", stl: "none", system_shared_libs: [], stubs: { versions: ["10", "20", "30"], }, }`) // check that libfoo and libbar are created only for myapex, but not for the platform Loading
cc/cc.go +9 −3 Original line number Diff line number Diff line Loading @@ -2638,10 +2638,16 @@ func (c *Module) AndroidMkWriteAdditionalDependenciesForSourceAbiDiff(w io.Write func (c *Module) DepIsInSameApex(ctx android.BaseModuleContext, dep android.Module) bool { if depTag, ok := ctx.OtherModuleDependencyTag(dep).(DependencyTag); ok { if cc, ok := dep.(*Module); ok { if cc.HasStubsVariants() && depTag.Shared && depTag.Library { if cc.HasStubsVariants() { if depTag.Shared && depTag.Library { // dynamic dep to a stubs lib crosses APEX boundary return false } if IsRuntimeDepTag(depTag) { // runtime dep to a stubs lib also crosses APEX boundary return false } } if depTag.FromStatic { // shared_lib dependency from a static lib is considered as crossing // the APEX boundary because the dependency doesn't actually is Loading