Merge "Fix: required deps from native module to phony module is respected" into main am: 635e1218bd
am: 6c74838269
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3081414 Change-Id: Ib71c7668a515f514fdb38188f3c583f4b989b0e5 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -1069,7 +1069,8 @@ func addRequiredDeps(ctx BottomUpMutatorContext) {
|
|||||||
// TODO(jiyong): the Make-side does this only when the required module is a shared
|
// TODO(jiyong): the Make-side does this only when the required module is a shared
|
||||||
// library or a native test.
|
// library or a native test.
|
||||||
bothInAndroid := ctx.Device() && target.Os.Class == Device
|
bothInAndroid := ctx.Device() && target.Os.Class == Device
|
||||||
nativeArch := InList(ctx.Arch().ArchType.Multilib, []string{"lib32", "lib64"})
|
nativeArch := InList(ctx.Arch().ArchType.Multilib, []string{"lib32", "lib64"}) &&
|
||||||
|
InList(target.Arch.ArchType.Multilib, []string{"lib32", "lib64"})
|
||||||
sameBitness := ctx.Arch().ArchType.Multilib == target.Arch.ArchType.Multilib
|
sameBitness := ctx.Arch().ArchType.Multilib == target.Arch.ArchType.Multilib
|
||||||
if bothInAndroid && nativeArch && !sameBitness {
|
if bothInAndroid && nativeArch && !sameBitness {
|
||||||
return
|
return
|
||||||
|
@@ -465,3 +465,35 @@ func TestPreventDuplicatedEntries(t *testing.T) {
|
|||||||
}
|
}
|
||||||
`)
|
`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestTrackPhonyAsRequiredDep(t *testing.T) {
|
||||||
|
result := fixture.RunTestWithBp(t, `
|
||||||
|
android_filesystem {
|
||||||
|
name: "fs",
|
||||||
|
deps: ["foo"],
|
||||||
|
}
|
||||||
|
|
||||||
|
cc_binary {
|
||||||
|
name: "foo",
|
||||||
|
required: ["phony"],
|
||||||
|
}
|
||||||
|
|
||||||
|
phony {
|
||||||
|
name: "phony",
|
||||||
|
required: ["libbar"],
|
||||||
|
}
|
||||||
|
|
||||||
|
cc_library {
|
||||||
|
name: "libbar",
|
||||||
|
}
|
||||||
|
`)
|
||||||
|
|
||||||
|
fs := result.ModuleForTests("fs", "android_common").Module().(*filesystem)
|
||||||
|
expected := []string{
|
||||||
|
"bin/foo",
|
||||||
|
"lib64/libbar.so",
|
||||||
|
}
|
||||||
|
for _, e := range expected {
|
||||||
|
android.AssertStringListContains(t, "missing entry", fs.entries, e)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user