Dedup cc binary build components registration
Bug: 146540677
Test: m nothing
Change-Id: I1c677d0ee2cead1d61f81e34e8d5a2f4a52f6cad
diff --git a/cc/binary.go b/cc/binary.go
index 617d4dd..ba6ed5f 100644
--- a/cc/binary.go
+++ b/cc/binary.go
@@ -56,8 +56,12 @@
}
func init() {
- android.RegisterModuleType("cc_binary", BinaryFactory)
- android.RegisterModuleType("cc_binary_host", binaryHostFactory)
+ RegisterBinaryBuildComponents(android.InitRegistrationContext)
+}
+
+func RegisterBinaryBuildComponents(ctx android.RegistrationContext) {
+ ctx.RegisterModuleType("cc_binary", BinaryFactory)
+ ctx.RegisterModuleType("cc_binary_host", binaryHostFactory)
}
// cc_binary produces a binary that is runnable on a device.