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
diff --git a/rust/library.go b/rust/library.go
index b266d04..3dc2559 100644
--- a/rust/library.go
+++ b/rust/library.go
@@ -38,7 +38,8 @@
}
type VariantLibraryProperties struct {
- Enabled *bool `android:"arch_variant"`
+ Enabled *bool `android:"arch_variant"`
+ Srcs []string `android:"path,arch_variant"`
}
type LibraryCompilerProperties struct {
@@ -355,7 +356,7 @@
if !ctx.Host() && library.static() {
library.setNoStdlibs()
for _, stdlib := range config.Stdlibs {
- deps.Rlibs = append(deps.Rlibs, stdlib+".static")
+ deps.Rlibs = append(deps.Rlibs, stdlib)
}
}