Don't make SplitPerApiLevel imply UseSdk
UseSdk was returning true when SplitPerApiLevel returned true, which was causing the platform variant of SplitPerApiLevel module to compile against the SDK. Check SplitPerApiLevel separately in the sdkMutator instead. Test: m checkbuild Change-Id: I0ae667d48a3b7b96709a6cad8e8ea9701659fc2a
This commit is contained in:
@@ -32,11 +32,11 @@ func sdkMutator(ctx android.BottomUpMutatorContext) {
|
||||
switch m := ctx.Module().(type) {
|
||||
case LinkableInterface:
|
||||
if m.AlwaysSdk() {
|
||||
if !m.UseSdk() {
|
||||
if !m.UseSdk() && !m.SplitPerApiLevel() {
|
||||
ctx.ModuleErrorf("UseSdk() must return true when AlwaysSdk is set, did the factory forget to set Sdk_version?")
|
||||
}
|
||||
ctx.CreateVariations("sdk")
|
||||
} else if m.UseSdk() {
|
||||
} else if m.UseSdk() || m.SplitPerApiLevel() {
|
||||
modules := ctx.CreateVariations("", "sdk")
|
||||
modules[0].(*Module).Properties.Sdk_version = nil
|
||||
modules[1].(*Module).Properties.IsSdkVariant = true
|
||||
|
Reference in New Issue
Block a user