Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit de25291b authored by Ivan Lozano's avatar Ivan Lozano
Browse files

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
parent 2895bf71
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -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
}