summaryrefslogtreecommitdiff
path: root/rust/binary.go
diff options
context:
space:
mode:
author Sam Delmerico <delmerico@google.com> 2023-09-08 20:46:55 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2023-09-08 20:46:55 +0000
commit1d3740a274114151b5bbe8cfe24c806d50fbcc8f (patch)
treeda263e6aaca05edb3b82ff6c6bc3f4f6be9a2794 /rust/binary.go
parent096b7e83bcfeff667852c75ce0da1e4d510e2750 (diff)
parent400749d1f02c1751dbcaee540a17da945a513f62 (diff)
Merge changes from topic "revert-2605644-rulebuilder-ninja-vars-OAAWYCDDLT" into main
* changes: Revert "add rust_toolchain_rustc_prebuilt module type" Revert "add crate_root property to rust modules" Revert "allow Ninja variables in RuleBuilder API"
Diffstat (limited to 'rust/binary.go')
-rw-r--r--rust/binary.go9
1 files changed, 2 insertions, 7 deletions
diff --git a/rust/binary.go b/rust/binary.go
index 2c9f64dd9..1e24bebab 100644
--- a/rust/binary.go
+++ b/rust/binary.go
@@ -137,14 +137,9 @@ func (binary *binaryDecorator) preferRlib() bool {
func (binary *binaryDecorator) compile(ctx ModuleContext, flags Flags, deps PathDeps) buildOutput {
fileName := binary.getStem(ctx) + ctx.toolchain().ExecutableSuffix()
+ srcPath, _ := srcPathFromModuleSrcs(ctx, binary.baseCompiler.Properties.Srcs)
outputFile := android.PathForModuleOut(ctx, fileName)
ret := buildOutput{outputFile: outputFile}
- var crateRootPath android.Path
- if binary.baseCompiler.Properties.Crate_root == nil {
- crateRootPath, _ = srcPathFromModuleSrcs(ctx, binary.baseCompiler.Properties.Srcs)
- } else {
- crateRootPath = android.PathForModuleSrc(ctx, *binary.baseCompiler.Properties.Crate_root)
- }
flags.RustFlags = append(flags.RustFlags, deps.depFlags...)
flags.LinkFlags = append(flags.LinkFlags, deps.depLinkFlags...)
@@ -159,7 +154,7 @@ func (binary *binaryDecorator) compile(ctx ModuleContext, flags Flags, deps Path
}
binary.baseCompiler.unstrippedOutputFile = outputFile
- ret.kytheFile = TransformSrcToBinary(ctx, crateRootPath, deps, flags, outputFile).kytheFile
+ ret.kytheFile = TransformSrcToBinary(ctx, srcPath, deps, flags, outputFile).kytheFile
return ret
}