rust: Add rustlibs auto dependency selection
Adds the rustlibs dependency type which will automatically select
between rlib and dylib based on the type of the library.
Bug: 143217452
Test: cd external/rust; mma
Change-Id: I97faadae98bf957090a32939cfb2d3a10f74a057
diff --git a/rust/library.go b/rust/library.go
index a53df85..b266d04 100644
--- a/rust/library.go
+++ b/rust/library.go
@@ -186,6 +186,16 @@
library.MutatedProperties.VariantIsDylib = false
}
+func (library *libraryDecorator) autoDep() autoDep {
+ if library.rlib() || library.static() {
+ return rlibAutoDep
+ } else if library.dylib() || library.shared() {
+ return dylibAutoDep
+ } else {
+ return rlibAutoDep
+ }
+}
+
var _ compiler = (*libraryDecorator)(nil)
var _ libraryInterface = (*libraryDecorator)(nil)