diff options
Diffstat (limited to 'cc/sdk.go')
-rw-r--r-- | cc/sdk.go | 38 |
1 files changed, 6 insertions, 32 deletions
@@ -49,45 +49,19 @@ func sdkMutator(ctx android.BottomUpMutatorContext) { modules[1].(*Module).Properties.IsSdkVariant = true if ctx.Config().UnbundledBuildApps() { - // For an unbundled apps build, hide the platform variant from Make. + // For an unbundled apps build, hide the platform variant from Make + // so that other Make modules don't link against it, but against the + // SDK variant. 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 } + // SDK variant never gets installed because the variant is to be embedded in + // APKs, not to be installed to the platform. + modules[1].(*Module).Properties.PreventInstall = true ctx.AliasVariation("") - } else if isCcModule && ccModule.isImportedApiLibrary() { - apiLibrary, _ := ccModule.linker.(*apiLibraryDecorator) - if apiLibrary.hasNDKStubs() && ccModule.canUseSdk() { - variations := []string{"sdk"} - if apiLibrary.hasApexStubs() { - variations = append(variations, "") - } - // Handle cc_api_library module with NDK stubs and variants only which can use SDK - modules := ctx.CreateVariations(variations...) - // Mark the SDK variant. - modules[0].(*Module).Properties.IsSdkVariant = true - if ctx.Config().UnbundledBuildApps() { - if apiLibrary.hasApexStubs() { - // For an unbundled apps build, hide the platform variant from Make. - modules[1].(*Module).Properties.HideFromMake = true - } - modules[1].(*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[0].(*Module).Properties.SdkAndPlatformVariantVisibleToMake = true - // SDK variant is not supposed to be installed - modules[0].(*Module).Properties.PreventInstall = true - } - } else { - ccModule.Properties.Sdk_version = nil - ctx.CreateVariations("") - ctx.AliasVariation("") - } } else { if isCcModule { // Clear the sdk_version property for modules that don't have an SDK variant so |