Add cross-referencing support for Rust
Bug: 222044478 Test: run TARGET_BUILD_VARIANT=userdebug TARGET_PRODUCT=cf_x86_64_phone XREF_CORPUS=googleplex-android.googlesource.com/codesearch/android build/soong/build_kzip.bash Change-Id: Ia12eed53fafd0cbbbf2cc499fa20a0f5a40031de
This commit is contained in:
@@ -474,8 +474,9 @@ func (library *libraryDecorator) compilerFlags(ctx ModuleContext, flags Flags) F
|
||||
return flags
|
||||
}
|
||||
|
||||
func (library *libraryDecorator) compile(ctx ModuleContext, flags Flags, deps PathDeps) android.Path {
|
||||
var outputFile, ret android.ModuleOutPath
|
||||
func (library *libraryDecorator) compile(ctx ModuleContext, flags Flags, deps PathDeps) buildOutput {
|
||||
var outputFile android.ModuleOutPath
|
||||
var ret buildOutput
|
||||
var fileName string
|
||||
srcPath := library.srcPath(ctx, deps)
|
||||
|
||||
@@ -487,19 +488,19 @@ func (library *libraryDecorator) compile(ctx ModuleContext, flags Flags, deps Pa
|
||||
if library.rlib() {
|
||||
fileName = library.getStem(ctx) + ctx.toolchain().RlibSuffix()
|
||||
outputFile = android.PathForModuleOut(ctx, fileName)
|
||||
ret = outputFile
|
||||
ret.outputFile = outputFile
|
||||
} else if library.dylib() {
|
||||
fileName = library.getStem(ctx) + ctx.toolchain().DylibSuffix()
|
||||
outputFile = android.PathForModuleOut(ctx, fileName)
|
||||
ret = outputFile
|
||||
ret.outputFile = outputFile
|
||||
} else if library.static() {
|
||||
fileName = library.getStem(ctx) + ctx.toolchain().StaticLibSuffix()
|
||||
outputFile = android.PathForModuleOut(ctx, fileName)
|
||||
ret = outputFile
|
||||
ret.outputFile = outputFile
|
||||
} else if library.shared() {
|
||||
fileName = library.sharedLibFilename(ctx)
|
||||
outputFile = android.PathForModuleOut(ctx, fileName)
|
||||
ret = outputFile
|
||||
ret.outputFile = outputFile
|
||||
}
|
||||
|
||||
if !library.rlib() && !library.static() && library.stripper.NeedsStrip(ctx) {
|
||||
@@ -524,13 +525,13 @@ func (library *libraryDecorator) compile(ctx ModuleContext, flags Flags, deps Pa
|
||||
|
||||
// Call the appropriate builder for this library type
|
||||
if library.rlib() {
|
||||
TransformSrctoRlib(ctx, srcPath, deps, flags, outputFile)
|
||||
ret.kytheFile = TransformSrctoRlib(ctx, srcPath, deps, flags, outputFile).kytheFile
|
||||
} else if library.dylib() {
|
||||
TransformSrctoDylib(ctx, srcPath, deps, flags, outputFile)
|
||||
ret.kytheFile = TransformSrctoDylib(ctx, srcPath, deps, flags, outputFile).kytheFile
|
||||
} else if library.static() {
|
||||
TransformSrctoStatic(ctx, srcPath, deps, flags, outputFile)
|
||||
ret.kytheFile = TransformSrctoStatic(ctx, srcPath, deps, flags, outputFile).kytheFile
|
||||
} else if library.shared() {
|
||||
TransformSrctoShared(ctx, srcPath, deps, flags, outputFile)
|
||||
ret.kytheFile = TransformSrctoShared(ctx, srcPath, deps, flags, outputFile).kytheFile
|
||||
}
|
||||
|
||||
if library.rlib() || library.dylib() {
|
||||
@@ -572,7 +573,7 @@ func (library *libraryDecorator) compile(ctx ModuleContext, flags Flags, deps Pa
|
||||
return ret
|
||||
}
|
||||
|
||||
func (library *libraryDecorator) srcPath(ctx ModuleContext, deps 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]
|
||||
|
Reference in New Issue
Block a user