aboutsummaryrefslogtreecommitdiffstats
path: root/rust/rust.go
diff options
context:
space:
mode:
authorIvan Lozano <ivanlozano@google.com>2019-09-06 15:29:52 -0700
committerIvan Lozano <ivanlozano@google.com>2019-09-06 16:06:21 -0700
commitde25291b6ea52e734005ee78fb9ccdab429ab560 (patch)
treecf1ad21b3511a824da6085372aeae3a60f699e2c /rust/rust.go
parent2895bf7182f1039f891652ed82e1c13b0cc11db1 (diff)
downloadbuild_soong-de25291b6ea52e734005ee78fb9ccdab429ab560.tar.gz
build_soong-de25291b6ea52e734005ee78fb9ccdab429ab560.tar.bz2
build_soong-de25291b6ea52e734005ee78fb9ccdab429ab560.zip
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
Diffstat (limited to 'rust/rust.go')
-rw-r--r--rust/rust.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/rust/rust.go b/rust/rust.go
index 5a2514e4..62ccfc74 100644
--- a/rust/rust.go
+++ b/rust/rust.go
@@ -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
}