Only output make targets for uninstallable static libs in the APEX
unavailable-to-platform case.
This removes the special case added in https://r.android.com/1274763
from SkipInstall(), so that it doesn't cause conflicting AndroidMk
entries when a cc_prebuilt_library_static module has prefer:true and
the corresponding source module exists.
Test: `m` in a tree with a snapshot created from art-module-sdk where
the libartimagevalues module has prefer:true
Bug: 151303681
Change-Id: I651ae325753b707296892adb4cae80daaddb6af2
diff --git a/cc/library.go b/cc/library.go
index 2a329ac..441c7b8 100644
--- a/cc/library.go
+++ b/cc/library.go
@@ -1365,16 +1365,15 @@
return android.CheckAvailableForApex(what, list)
}
-func (library *libraryDecorator) skipInstall(mod *Module) {
+func (library *libraryDecorator) makeUninstallable(mod *Module) {
if library.static() && library.buildStatic() && !library.buildStubs() {
- // If we're asked to skip installation of a static library (in particular
- // when it's not //apex_available:platform) we still want an AndroidMk entry
- // for it to ensure we get the relevant NOTICE file targets (cf.
- // notice_files.mk) that other libraries might depend on. AndroidMkEntries
- // always sets LOCAL_UNINSTALLABLE_MODULE for these entries.
+ // If we're asked to make a static library uninstallable we don't do
+ // anything since AndroidMkEntries always sets LOCAL_UNINSTALLABLE_MODULE
+ // for these entries. This is done to still get the make targets for NOTICE
+ // files from notice_files.mk, which other libraries might depend on.
return
}
- mod.ModuleBase.SkipInstall()
+ mod.ModuleBase.MakeUninstallable()
}
var versioningMacroNamesListKey = android.NewOnceKey("versioningMacroNamesList")