diff options
author | 2023-09-08 20:46:55 +0000 | |
---|---|---|
committer | 2023-09-08 20:46:55 +0000 | |
commit | 1d3740a274114151b5bbe8cfe24c806d50fbcc8f (patch) | |
tree | da263e6aaca05edb3b82ff6c6bc3f4f6be9a2794 /rust/library.go | |
parent | 096b7e83bcfeff667852c75ce0da1e4d510e2750 (diff) | |
parent | 400749d1f02c1751dbcaee540a17da945a513f62 (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/library.go')
-rw-r--r-- | rust/library.go | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/rust/library.go b/rust/library.go index 7432a12be..3f031c10c 100644 --- a/rust/library.go +++ b/rust/library.go @@ -489,7 +489,7 @@ func (library *libraryDecorator) compile(ctx ModuleContext, flags Flags, deps Pa var outputFile android.ModuleOutPath var ret buildOutput var fileName string - crateRootPath := library.crateRootPath(ctx, deps) + srcPath := library.srcPath(ctx, deps) if library.sourceProvider != nil { deps.srcProviderFiles = append(deps.srcProviderFiles, library.sourceProvider.Srcs()...) @@ -536,13 +536,13 @@ func (library *libraryDecorator) compile(ctx ModuleContext, flags Flags, deps Pa // Call the appropriate builder for this library type if library.rlib() { - ret.kytheFile = TransformSrctoRlib(ctx, crateRootPath, deps, flags, outputFile).kytheFile + ret.kytheFile = TransformSrctoRlib(ctx, srcPath, deps, flags, outputFile).kytheFile } else if library.dylib() { - ret.kytheFile = TransformSrctoDylib(ctx, crateRootPath, deps, flags, outputFile).kytheFile + ret.kytheFile = TransformSrctoDylib(ctx, srcPath, deps, flags, outputFile).kytheFile } else if library.static() { - ret.kytheFile = TransformSrctoStatic(ctx, crateRootPath, deps, flags, outputFile).kytheFile + ret.kytheFile = TransformSrctoStatic(ctx, srcPath, deps, flags, outputFile).kytheFile } else if library.shared() { - ret.kytheFile = TransformSrctoShared(ctx, crateRootPath, deps, flags, outputFile).kytheFile + ret.kytheFile = TransformSrctoShared(ctx, srcPath, deps, flags, outputFile).kytheFile } if library.rlib() || library.dylib() { @@ -585,15 +585,13 @@ func (library *libraryDecorator) compile(ctx ModuleContext, flags Flags, deps Pa return ret } -func (library *libraryDecorator) crateRootPath(ctx ModuleContext, _ PathDeps) android.Path { +func (library *libraryDecorator) srcPath(ctx ModuleContext, _ PathDeps) android.Path { if library.sourceProvider != nil { // Assume the first source from the source provider is the library entry point. return library.sourceProvider.Srcs()[0] - } else if library.baseCompiler.Properties.Crate_root == nil { + } else { path, _ := srcPathFromModuleSrcs(ctx, library.baseCompiler.Properties.Srcs) return path - } else { - return android.PathForModuleSrc(ctx, *library.baseCompiler.Properties.Crate_root) } } @@ -608,7 +606,7 @@ func (library *libraryDecorator) rustdoc(ctx ModuleContext, flags Flags, return android.OptionalPath{} } - return android.OptionalPathForPath(Rustdoc(ctx, library.crateRootPath(ctx, deps), + return android.OptionalPathForPath(Rustdoc(ctx, library.srcPath(ctx, deps), deps, flags)) } |