Disable cc_benchmark for Darwin hosts
The google-benchmark library is disabled on Darwin, so we cannot create
host benchmarks. Instead of having every user specify this, put the
logic in Soong. Then if we decide to support it later, it's an easier
switch.
Test: build.ninja identical before/after on Linux
Test: Ignores failing cc_benchmark_host on Darwin
Change-Id: I61f3a571fd160d8e479a512992bc68601f1c9b28
diff --git a/android/module.go b/android/module.go
index f815ced..00219ae 100644
--- a/android/module.go
+++ b/android/module.go
@@ -152,6 +152,7 @@
// Set by InitAndroidModule
HostOrDeviceSupported HostOrDeviceSupported `blueprint:"mutated"`
+ ArchSpecific bool `blueprint:"mutated"`
}
type hostAndDeviceProperties struct {
@@ -176,6 +177,7 @@
DeviceSupported
HostAndDeviceSupported
HostAndDeviceDefault
+ NeitherHostNorDeviceSupported
)
func InitAndroidModule(m Module,
@@ -197,6 +199,7 @@
base := m.base()
base.commonProperties.HostOrDeviceSupported = hod
base.commonProperties.Default_multilib = string(defaultMultilib)
+ base.commonProperties.ArchSpecific = true
switch hod {
case HostAndDeviceSupported:
@@ -305,6 +308,10 @@
return a.Target().Arch
}
+func (a *ModuleBase) ArchSpecific() bool {
+ return a.commonProperties.ArchSpecific
+}
+
func (a *ModuleBase) OsClassSupported() []OsClass {
switch a.commonProperties.HostOrDeviceSupported {
case HostSupported: