summaryrefslogtreecommitdiff
path: root/rust/library.go
diff options
context:
space:
mode:
author Matthew Maurer <mmaurer@google.com> 2020-06-25 00:47:46 -0700
committer Matthew Maurer <mmaurer@google.com> 2020-07-01 11:27:12 -0700
commitc761eeca4829c7c5a1ab24569a414219f595ec63 (patch)
tree7f91ce86119df2de0e0c318b1d543df3a85aa6b8 /rust/library.go
parent0f003b18516df3df3fa631ca6d1e21322d0947cf (diff)
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
Diffstat (limited to 'rust/library.go')
-rw-r--r--rust/library.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/rust/library.go b/rust/library.go
index b266d04ca..3dc2559e9 100644
--- a/rust/library.go
+++ b/rust/library.go
@@ -38,7 +38,8 @@ func init() {
}
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 @@ func (library *libraryDecorator) compilerDeps(ctx DepsContext, deps Deps) Deps {
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)
}
}