summaryrefslogtreecommitdiff
path: root/rust/library.go
diff options
context:
space:
mode:
author Ivan Lozano <ivanlozano@google.com> 2020-08-18 14:31:23 -0400
committer Ivan Lozano <ivanlozano@google.com> 2020-08-25 13:32:53 -0400
commit042504f7d60857dd3d6292d56b3356a8a2d617d0 (patch)
tree5b8584d2c974db83080330c2b93e08b22711ced2 /rust/library.go
parentf5a2b8a64113630ce0d8d5922f96e951fb2c9f12 (diff)
Link device binaries dynamically by default.
Device binaries currently are linked statically by default. Instead we should be linking these dynamic by default. To avoid conflicts when manually specifying rlib dependencies on modules, we always link libstd dynamically for all device modules except static libraries. This removes the "prefer_dynamic" property entirely to avoid confusion. Bug: 165161105 Test: m profcollectd is built dynamically. Test: cd external/rust/; mma Test: cd external/crosvm/; mma Change-Id: I25ac897040acbcc2d97c791a33e8e01610632272
Diffstat (limited to 'rust/library.go')
-rw-r--r--rust/library.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/rust/library.go b/rust/library.go
index 6766d618b..91fbe0fda 100644
--- a/rust/library.go
+++ b/rust/library.go
@@ -176,13 +176,13 @@ func (library *libraryDecorator) setStatic() {
library.MutatedProperties.VariantIsDylib = false
}
-func (library *libraryDecorator) autoDep() autoDep {
+func (library *libraryDecorator) autoDep(ctx BaseModuleContext) autoDep {
if library.rlib() || library.static() {
return rlibAutoDep
} else if library.dylib() || library.shared() {
return dylibAutoDep
} else {
- return rlibAutoDep
+ panic("autoDep called on library" + ctx.ModuleName() + "that has no enabled variants.")
}
}