diff options
author | 2021-12-15 15:28:00 +0000 | |
---|---|---|
committer | 2021-12-15 15:28:00 +0000 | |
commit | f25ab75d63805bd6db252d49fa8e47d56e797a0e (patch) | |
tree | 0c4637c08a196d68fce8825195014b6f5fbe2703 /rust/test.go | |
parent | b29852a3da5c3e3c1a2ad5e1b678ae547632ebc4 (diff) | |
parent | f5c98a2fe5905cf3ee8487906f7ba1f88f3b3ab2 (diff) |
Merge "rust: Fix Host multilib prop for rust_test modules."
Diffstat (limited to 'rust/test.go')
-rw-r--r-- | rust/test.go | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/rust/test.go b/rust/test.go index 3eea0ada4..250b7657e 100644 --- a/rust/test.go +++ b/rust/test.go @@ -210,6 +210,12 @@ func init() { func RustTestFactory() android.Module { module, _ := NewRustTest(android.HostAndDeviceSupported) + + // NewRustTest will set MultilibBoth true, however the host variant + // cannot produce the non-primary target. Therefore, add the + // rustTestHostMultilib load hook to set MultilibFirst for the + // host target. + android.AddLoadHook(module, rustTestHostMultilib) return module.Init() } @@ -236,3 +242,16 @@ func (test *testDecorator) compilerDeps(ctx DepsContext, deps Deps) Deps { func (test *testDecorator) testBinary() bool { return true } + +func rustTestHostMultilib(ctx android.LoadHookContext) { + type props struct { + Target struct { + Host struct { + Compile_multilib *string + } + } + } + p := &props{} + p.Target.Host.Compile_multilib = proptools.StringPtr("first") + ctx.AppendProperties(p) +} |