Add gensrcs module type
gensrcs allows sources to be generated by a specified command.
Change-Id: I725086fcdcd72bfe6c07fb8903e7b520678a247f
diff --git a/common/arch.go b/common/arch.go
index bc2a9d9..cb4e998 100644
--- a/common/arch.go
+++ b/common/arch.go
@@ -280,6 +280,10 @@
}
}
+ if len(arches) == 0 {
+ return
+ }
+
archNames := []string{}
for _, arch := range arches {
archNames = append(archNames, arch.String())
@@ -301,8 +305,6 @@
base.commonProperties.Compile_multilib = string(defaultMultilib)
base.generalProperties = append(base.generalProperties,
- &base.commonProperties)
- base.generalProperties = append(base.generalProperties,
propertyStructs...)
for _, properties := range base.generalProperties {
diff --git a/common/module.go b/common/module.go
index ba33ec6..9bdd7c1 100644
--- a/common/module.go
+++ b/common/module.go
@@ -87,11 +87,23 @@
MultilibFirst Multilib = "first"
)
-func InitAndroidModule(m AndroidModule, hod HostOrDeviceSupported, defaultMultilib Multilib,
+func InitAndroidModule(m AndroidModule,
propertyStructs ...interface{}) (blueprint.Module, []interface{}) {
base := m.base()
base.module = m
+
+ propertyStructs = append(propertyStructs, &base.commonProperties)
+
+ return m, propertyStructs
+}
+
+func InitAndroidArchModule(m AndroidModule, hod HostOrDeviceSupported, defaultMultilib Multilib,
+ propertyStructs ...interface{}) (blueprint.Module, []interface{}) {
+
+ _, propertyStructs = InitAndroidModule(m, propertyStructs...)
+
+ base := m.base()
base.commonProperties.HostOrDeviceSupported = hod
if hod == HostAndDeviceSupported {