diff options
author | 2020-06-29 14:34:06 -0700 | |
---|---|---|
committer | 2020-07-01 11:27:12 -0700 | |
commit | 0f003b18516df3df3fa631ca6d1e21322d0947cf (patch) | |
tree | e27bef149ff927ca9364aef6722263259e1e6ce3 /rust/library.go | |
parent | 2ae0513a8e4f226c2161fb89e85ef997b0881278 (diff) |
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
Diffstat (limited to 'rust/library.go')
-rw-r--r-- | rust/library.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/rust/library.go b/rust/library.go index a53df85d7..b266d04ca 100644 --- a/rust/library.go +++ b/rust/library.go @@ -186,6 +186,16 @@ func (library *libraryDecorator) setStatic() { 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) |