diff options
Diffstat (limited to 'rust/binary.go')
| -rw-r--r-- | rust/binary.go | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/rust/binary.go b/rust/binary.go index 7c18730c6..db91ccb9a 100644 --- a/rust/binary.go +++ b/rust/binary.go @@ -34,6 +34,7 @@ type BinaryCompilerProperties struct { type binaryInterface interface { binary() bool staticallyLinked() bool + testBinary() bool } type binaryDecorator struct { @@ -122,20 +123,24 @@ func (binary *binaryDecorator) compile(ctx ModuleContext, flags Flags, deps Path fileName := binary.getStem(ctx) + ctx.toolchain().ExecutableSuffix() srcPath, _ := srcPathFromModuleSrcs(ctx, binary.baseCompiler.Properties.Srcs) outputFile := android.PathForModuleOut(ctx, fileName) + ret := outputFile flags.RustFlags = append(flags.RustFlags, deps.depFlags...) flags.LinkFlags = append(flags.LinkFlags, deps.depLinkFlags...) flags.LinkFlags = append(flags.LinkFlags, deps.linkObjects...) - TransformSrcToBinary(ctx, srcPath, deps, flags, outputFile) - if binary.stripper.NeedsStrip(ctx) { - strippedOutputFile := android.PathForModuleOut(ctx, "stripped", fileName) + strippedOutputFile := outputFile + outputFile = android.PathForModuleOut(ctx, "unstripped", fileName) binary.stripper.StripExecutableOrSharedLib(ctx, outputFile, strippedOutputFile) - binary.strippedOutputFile = android.OptionalPathForPath(strippedOutputFile) + + binary.baseCompiler.strippedOutputFile = android.OptionalPathForPath(strippedOutputFile) } + binary.baseCompiler.unstrippedOutputFile = outputFile - return outputFile + TransformSrcToBinary(ctx, srcPath, deps, flags, outputFile) + + return ret } func (binary *binaryDecorator) autoDep(ctx android.BottomUpMutatorContext) autoDep { @@ -168,3 +173,7 @@ func (binary *binaryDecorator) binary() bool { func (binary *binaryDecorator) staticallyLinked() bool { return Bool(binary.Properties.Static_executable) } + +func (binary *binaryDecorator) testBinary() bool { + return false +} |