summaryrefslogtreecommitdiff
path: root/cc/sdk.go
diff options
context:
space:
mode:
Diffstat (limited to 'cc/sdk.go')
-rw-r--r--cc/sdk.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/cc/sdk.go b/cc/sdk.go
index ec57f06f4..2c3fec3fd 100644
--- a/cc/sdk.go
+++ b/cc/sdk.go
@@ -38,18 +38,31 @@ func sdkMutator(ctx android.BottomUpMutatorContext) {
ctx.CreateVariations("sdk")
} else if m.UseSdk() || m.SplitPerApiLevel() {
modules := ctx.CreateVariations("", "sdk")
+
+ // Clear the sdk_version property for the platform (non-SDK) variant so later code
+ // doesn't get confused by it.
modules[0].(*Module).Properties.Sdk_version = nil
+
+ // Mark the SDK variant.
modules[1].(*Module).Properties.IsSdkVariant = true
if ctx.Config().UnbundledBuildApps() {
+ // For an unbundled apps build, hide the platform variant from Make.
modules[0].(*Module).Properties.HideFromMake = true
modules[0].(*Module).Properties.PreventInstall = true
} else {
+ // For a platform build, mark the SDK variant so that it gets a ".sdk" suffix when
+ // exposed to Make.
modules[1].(*Module).Properties.SdkAndPlatformVariantVisibleToMake = true
modules[1].(*Module).Properties.PreventInstall = true
}
ctx.AliasVariation("")
} else {
+ if m, ok := ctx.Module().(*Module); ok {
+ // Clear the sdk_version property for modules that don't have an SDK variant so
+ // later code doesn't get confused by it.
+ m.Properties.Sdk_version = nil
+ }
ctx.CreateVariations("")
ctx.AliasVariation("")
}