diff options
| author | 2023-09-08 00:10:18 +0000 | |
|---|---|---|
| committer | 2023-09-08 00:10:18 +0000 | |
| commit | 9abcf649a7cc75aeeb2cc1931b852c35302fe16c (patch) | |
| tree | ca802ce21d2aefb0512b0e14f4b53610cd83d9ac /rust/binary.go | |
| parent | 509ca8dfaf51ff58d8d331a160a5cfe4584352c4 (diff) | |
| parent | 1f9bb26656b10a367e862270cdcdfba8214e522a (diff) | |
Merge changes from topics "rulebuilder-ninja-vars", "rustc_prebuilt_build_tool" into main
* changes:
allow Ninja variables in RuleBuilder API
add crate_root property to rust modules
add rust_toolchain_rustc_prebuilt module type
Diffstat (limited to 'rust/binary.go')
| -rw-r--r-- | rust/binary.go | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/rust/binary.go b/rust/binary.go index 1e24bebab..2c9f64dd9 100644 --- a/rust/binary.go +++ b/rust/binary.go @@ -137,9 +137,14 @@ 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...) @@ -154,7 +159,7 @@ func (binary *binaryDecorator) compile(ctx ModuleContext, flags Flags, deps Path } binary.baseCompiler.unstrippedOutputFile = outputFile - ret.kytheFile = TransformSrcToBinary(ctx, srcPath, deps, flags, outputFile).kytheFile + ret.kytheFile = TransformSrcToBinary(ctx, crateRootPath, deps, flags, outputFile).kytheFile return ret } |