rust: Mutate prebuilt modules dylib/rlib

This change makes it possible to use a single module to provide both
dylib and rlib varieties of a library. This allows the use of libstd and
libtest from a rustlibs property, allowing linkage type to change
for different variants.

Bug: 159718669
Test: cd external crates; mma; m crosvm.experimental
Change-Id: I477c4d2faec63703fdc6dd42ba020747d6a50714
This commit is contained in:
Matthew Maurer
2020-06-25 00:47:46 -07:00
parent 0f003b1851
commit c761eeca48
5 changed files with 76 additions and 36 deletions

View File

@@ -440,6 +440,9 @@ func (mod *Module) HasStaticVariant() bool {
func (mod *Module) CoverageFiles() android.Paths {
if mod.compiler != nil {
if !mod.compiler.nativeCoverage() {
return android.Paths{}
}
if library, ok := mod.compiler.(*libraryDecorator); ok {
if library.coverageFile != nil {
return android.Paths{library.coverageFile}