sdk modules are by default compile_multilib: "both"
Bug: 143948100 Test: m (sdk_test.go amended) Change-Id: I7df1b96af49a6569012e44eeb3c0722fac63fa51
This commit is contained in:
@@ -19,6 +19,7 @@ import (
|
|||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"github.com/google/blueprint"
|
"github.com/google/blueprint"
|
||||||
|
"github.com/google/blueprint/proptools"
|
||||||
|
|
||||||
"android/soong/android"
|
"android/soong/android"
|
||||||
// This package doesn't depend on the apex package, but import it to make its mutators to be
|
// This package doesn't depend on the apex package, but import it to make its mutators to be
|
||||||
@@ -60,6 +61,13 @@ func ModuleFactory() android.Module {
|
|||||||
s.AddProperties(&s.properties)
|
s.AddProperties(&s.properties)
|
||||||
android.InitAndroidMultiTargetsArchModule(s, android.HostAndDeviceSupported, android.MultilibCommon)
|
android.InitAndroidMultiTargetsArchModule(s, android.HostAndDeviceSupported, android.MultilibCommon)
|
||||||
android.InitDefaultableModule(s)
|
android.InitDefaultableModule(s)
|
||||||
|
android.AddLoadHook(s, func(ctx android.LoadHookContext) {
|
||||||
|
type props struct {
|
||||||
|
Compile_multilib *string
|
||||||
|
}
|
||||||
|
p := &props{Compile_multilib: proptools.StringPtr("both")}
|
||||||
|
ctx.AppendProperties(p)
|
||||||
|
})
|
||||||
return s
|
return s
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -377,6 +377,35 @@ func TestDepNotInRequiredSdks(t *testing.T) {
|
|||||||
`)
|
`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestSdkIsCompileMultilibBoth(t *testing.T) {
|
||||||
|
ctx, _ := testSdk(t, `
|
||||||
|
sdk {
|
||||||
|
name: "mysdk",
|
||||||
|
native_shared_libs: ["sdkmember"],
|
||||||
|
}
|
||||||
|
|
||||||
|
cc_library_shared {
|
||||||
|
name: "sdkmember",
|
||||||
|
srcs: ["Test.cpp"],
|
||||||
|
system_shared_libs: [],
|
||||||
|
stl: "none",
|
||||||
|
}
|
||||||
|
`)
|
||||||
|
|
||||||
|
armOutput := ctx.ModuleForTests("sdkmember", "android_arm_armv7-a-neon_core_shared").Module().(*cc.Module).OutputFile()
|
||||||
|
arm64Output := ctx.ModuleForTests("sdkmember", "android_arm64_armv8-a_core_shared").Module().(*cc.Module).OutputFile()
|
||||||
|
|
||||||
|
var inputs []string
|
||||||
|
buildParams := ctx.ModuleForTests("mysdk", "android_common").Module().BuildParamsForTests()
|
||||||
|
for _, bp := range buildParams {
|
||||||
|
inputs = append(inputs, bp.Implicits.Strings()...)
|
||||||
|
}
|
||||||
|
|
||||||
|
// ensure that both 32/64 outputs are inputs of the sdk snapshot
|
||||||
|
ensureListContains(t, inputs, armOutput.String())
|
||||||
|
ensureListContains(t, inputs, arm64Output.String())
|
||||||
|
}
|
||||||
|
|
||||||
var buildDir string
|
var buildDir string
|
||||||
|
|
||||||
func setUp() {
|
func setUp() {
|
||||||
|
Reference in New Issue
Block a user