diff options
author | 2020-06-23 14:28:53 -0700 | |
---|---|---|
committer | 2020-07-01 11:27:12 -0700 | |
commit | 2ae0513a8e4f226c2161fb89e85ef997b0881278 (patch) | |
tree | 96461712a9596a4c14dc38e6f6f2c9e1ab3a97d7 /rust/library_test.go | |
parent | 128f53b3b471b969209f7208acca55a80f14c702 (diff) |
rust: Change default variants
rust_library now produces only rlib and dylib variants.
rust_library_foreign now produces static and shared variants.
This change was made because both are common cases, but all four
together essentially never happens. This allows us to have fewer repeat
module definitions.
Bug: 143217452
Test: cd external/rust; mma
Change-Id: Iaf69e8da38f7c12710331c51464699cf7cbbb656
Diffstat (limited to 'rust/library_test.go')
-rw-r--r-- | rust/library_test.go | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/rust/library_test.go b/rust/library_test.go index 9d2f6c00a..bc3d870c0 100644 --- a/rust/library_test.go +++ b/rust/library_test.go @@ -29,13 +29,18 @@ func TestLibraryVariants(t *testing.T) { name: "libfoo", srcs: ["foo.rs"], crate_name: "foo", - }`) + } + rust_ffi_host { + name: "libfoo.ffi", + srcs: ["foo.rs"], + crate_name: "foo" + }`) // Test all variants are being built. libfooRlib := ctx.ModuleForTests("libfoo", "linux_glibc_x86_64_rlib").Output("libfoo.rlib") libfooDylib := ctx.ModuleForTests("libfoo", "linux_glibc_x86_64_dylib").Output("libfoo.dylib.so") - libfooStatic := ctx.ModuleForTests("libfoo", "linux_glibc_x86_64_static").Output("libfoo.a") - libfooShared := ctx.ModuleForTests("libfoo", "linux_glibc_x86_64_shared").Output("libfoo.so") + libfooStatic := ctx.ModuleForTests("libfoo.ffi", "linux_glibc_x86_64_static").Output("libfoo.ffi.a") + libfooShared := ctx.ModuleForTests("libfoo.ffi", "linux_glibc_x86_64_shared").Output("libfoo.ffi.so") rlibCrateType := "rlib" dylibCrateType := "dylib" @@ -119,7 +124,7 @@ func TestValidateLibraryStem(t *testing.T) { func TestSharedLibrary(t *testing.T) { ctx := testRust(t, ` - rust_library { + rust_ffi_shared { name: "libfoo", srcs: ["foo.rs"], crate_name: "foo", |