Keep vndk library lists sorted

soong_build was writing a different make_vars-*.mk on every run
because the lists of vndk libraries were not sorted, causing
kati to regenerate the ninja file.

Test: m -j nothing && rm out/soong/build.ninja && m -j nothing
Change-Id: If1ef51bad602d61a337ee6f62d4758d4123cb00d
This commit is contained in:
Colin Cross 2017-08-17 14:55:15 -07:00
parent b90afd09d6
commit 766efbc9e9

View file

@ -15,6 +15,7 @@
package cc
import (
"sort"
"strings"
"sync"
@ -116,6 +117,7 @@ func vndkMutator(mctx android.BottomUpMutatorContext) {
name := strings.TrimSuffix(m.Name(), llndkLibrarySuffix)
if !inList(name, llndkLibraries) {
llndkLibraries = append(llndkLibraries, name)
sort.Strings(llndkLibraries)
}
} else if lib, ok := m.linker.(*libraryDecorator); ok && lib.shared() {
if m.vndkdep.isVndk() {
@ -124,10 +126,12 @@ func vndkMutator(mctx android.BottomUpMutatorContext) {
if m.vndkdep.isVndkSp() {
if !inList(m.Name(), vndkSpLibraries) {
vndkSpLibraries = append(vndkSpLibraries, m.Name())
sort.Strings(vndkSpLibraries)
}
} else {
if !inList(m.Name(), vndkCoreLibraries) {
vndkCoreLibraries = append(vndkCoreLibraries, m.Name())
sort.Strings(vndkCoreLibraries)
}
}
}