summaryrefslogtreecommitdiff
path: root/rust/binary.go
diff options
context:
space:
mode:
authorIvan Lozano <ivanlozano@google.com>2020-09-28 13:22:45 -0400
committerIvan Lozano <ivanlozano@google.com>2020-09-28 13:26:05 -0400
commitdd0554722ac788bb5cdfbfe2fc5b8568eeb5372e (patch)
tree0b4750fde9c7bb7d7c30012fc026ce1cd770efe2 /rust/binary.go
parent11200870b0cd84e9bbccb89b66cf59b5ed4db526 (diff)
rust: Refactor staticStd to stdLinkage
Instead of returning a boolean, return an enum value to improve readability and provide greater flexibility for future modifications. Bug: 168729404 Test: Soong tests pass Change-Id: Iddcdae8c34be09e476404382e43d1ea5935bae65
Diffstat (limited to 'rust/binary.go')
-rw-r--r--rust/binary.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/rust/binary.go b/rust/binary.go
index e95cb3afc..2758ae077 100644
--- a/rust/binary.go
+++ b/rust/binary.go
@@ -145,6 +145,9 @@ func (binary *binaryDecorator) autoDep(ctx BaseModuleContext) autoDep {
}
}
-func (binary *binaryDecorator) staticStd(ctx *depsContext) bool {
- return binary.baseCompiler.staticStd(ctx) || Bool(binary.Properties.Prefer_rlib)
+func (binary *binaryDecorator) stdLinkage(ctx *depsContext) RustLinkage {
+ if Bool(binary.Properties.Prefer_rlib) {
+ return RlibLinkage
+ }
+ return binary.baseCompiler.stdLinkage(ctx)
}