Disable unsupported Rust targets.

Explicitly disable targets requiring unsupported toolchains when
processing Rust modules.

Bug: 140640858
Test: Darwin builds no longer breaking.
Change-Id: I8c60a2829508ae6de16bf347060818ca5c04f65e
This commit is contained in:
Ivan Lozano
2019-09-06 15:29:52 -07:00
parent 2895bf7182
commit de25291b6e

View File

@@ -173,6 +173,24 @@ func (mod *Module) Init() android.Module {
android.InitDefaultableModule(mod)
// Explicitly disable unsupported targets.
android.AddLoadHook(mod, func(ctx android.LoadHookContext) {
disableTargets := struct {
Target struct {
Darwin struct {
Enabled *bool
}
Linux_bionic struct {
Enabled *bool
}
}
}{}
disableTargets.Target.Darwin.Enabled = proptools.BoolPtr(false)
disableTargets.Target.Linux_bionic.Enabled = proptools.BoolPtr(false)
ctx.AppendProperties(&disableTargets)
})
return mod
}