diff options
author | 2019-10-18 14:49:46 -0700 | |
---|---|---|
committer | 2019-10-28 22:09:01 -0700 | |
commit | 52767be335c200dfbf2af3da802e24a1cc91f1bf (patch) | |
tree | e9501012123d5a37570c03646bff99a79d3d385e /rust/androidmk.go | |
parent | 183a3218e257b6d1dcd6636f136ede87411b13f4 (diff) |
Add support for Rust C libraries.
Adds the ability for rust modules to be compiled as C libraries, and
allows cc modules to depend on these rust-generated modules. This also
means that soong-rust should not have any dependencies on soong-cc aside
from what's required for testing.
There's a couple small fixes included as well:
- A bug in libNameFromFilePath that caused issues when library's had
"lib" in their name.
- VariantName is removed from rust library MutatedProperties since this
was unused.
Bug: 140726209
Test: Soong tests pass.
Test: Example cc_binary can include a rust shared library as a dep.
Test: m crosvm.experimental
Change-Id: Ia7deed1345d2423001089014cc65ce7934123da4
Diffstat (limited to 'rust/androidmk.go')
-rw-r--r-- | rust/androidmk.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/rust/androidmk.go b/rust/androidmk.go index a6208dbcd..f933cfbcf 100644 --- a/rust/androidmk.go +++ b/rust/androidmk.go @@ -92,7 +92,12 @@ func (library *libraryDecorator) AndroidMk(ctx AndroidMkContext, ret *android.An ret.Class = "RLIB_LIBRARIES" } else if library.dylib() { ret.Class = "DYLIB_LIBRARIES" + } else if library.static() { + ret.Class = "STATIC_LIBRARIES" + } else if library.shared() { + ret.Class = "SHARED_LIBRARIES" } + ret.DistFile = library.distFile ret.Extra = append(ret.Extra, func(w io.Writer, outputFile android.Path) { if !library.rlib() { |