Support Rust in native-bridge

Bug: 178565008
Bug: 165791368
Test: Build and link a Rust library into a native-bridge binary
Change-Id: I3546571530529203d9dbfd62777f20de18c6bd51
This commit is contained in:
Matthew Maurer
2021-05-27 11:09:11 -07:00
parent 52af5b052b
commit a61e31f66a
3 changed files with 12 additions and 4 deletions

View File

@@ -766,6 +766,10 @@ func (ctx *baseModuleContext) toolchain() config.Toolchain {
}
func (mod *Module) nativeCoverage() bool {
// Bug: http://b/137883967 - native-bridge modules do not currently work with coverage
if mod.Target().NativeBridge == android.NativeBridgeEnabled {
return false
}
return mod.compiler != nil && mod.compiler.nativeCoverage()
}
@@ -819,6 +823,10 @@ func (mod *Module) GenerateAndroidBuildActions(actx android.ModuleContext) {
mod.Properties.SubName += cc.RecoverySuffix
}
if mod.Target().NativeBridge == android.NativeBridgeEnabled {
mod.Properties.SubName += cc.NativeBridgeSuffix
}
if !toolchain.Supported() {
// This toolchain's unsupported, there's nothing to do for this mod.
return