Support the 'host' conditional in androidbp
Change-Id: I01eaa1ad2e05aaf8cbf00286d7272d0f45bb18aa
diff --git a/androidbp/cmd/androidbp.go b/androidbp/cmd/androidbp.go
index 560ef84..a8f4580 100644
--- a/androidbp/cmd/androidbp.go
+++ b/androidbp/cmd/androidbp.go
@@ -271,7 +271,7 @@
} else if "target" == prop.Name.Name {
props := w.lookupMap(prop.Value)
standardProps = append(standardProps, translateTargetConditionals(props, disabledBuilds, module.isHostRule)...)
- } else if "host_supported" == prop.Name.Name {
+ } else if _, ok := ignoredProperties[prop.Name.Name]; ok {
} else {
standardProps = append(standardProps, fmt.Sprintf("# ERROR: Unsupported property %s", prop.Name.Name))
}
diff --git a/androidbp/cmd/soong.go b/androidbp/cmd/soong.go
index 1f15aac..8afda77 100644
--- a/androidbp/cmd/soong.go
+++ b/androidbp/cmd/soong.go
@@ -71,6 +71,10 @@
"suffix": {"LOCAL_MODULE_STEM", prependLocalModule},
}
+var ignoredProperties = map[string]bool{
+ "host_supported": true,
+}
+
var moduleTypeToRule = map[string]string{
"cc_library_shared": "BUILD_SHARED_LIBRARY",
"cc_library_static": "BUILD_STATIC_LIBRARY",
@@ -97,6 +101,7 @@
}
var hostScopedPropertyConditionals = map[string]string{
+ "host": "",
"darwin": "ifeq ($(HOST_OS), darwin)",
"not_darwin": "ifneq ($(HOST_OS), darwin)",
"windows": "ifeq ($(HOST_OS), windows)",