gn2bp: Only compile x64 for host machines
* The generated desc_*.json files except the compiling(not target) cpu architecture to be x64. which
was an issue because Soong tries to compile for both x32 and x64.
Test: mma
Change-Id: I6be5ed045a25e4020e69bf0157f919f43e68e2c0
diff --git a/tools/gn2bp/gen_android_bp b/tools/gn2bp/gen_android_bp
index a0e719d..c339664 100755
--- a/tools/gn2bp/gen_android_bp
+++ b/tools/gn2bp/gen_android_bp
@@ -327,6 +327,9 @@
self.generated_headers = set()
self.export_generated_headers = set()
self.ldflags = set()
+ self.compile_multilib = None
+ if name == 'host':
+ self.compile_multilib = '64'
def to_string(self, output):
nested_out = []
@@ -347,6 +350,9 @@
self._output_field(nested_out, 'ldflags')
if nested_out:
+ # This is added here to make sure it doesn't add a `host` arch-specific module just for
+ # `compile_multilib` flag.
+ self._output_field(nested_out, 'compile_multilib')
output.append(' %s: {' % self.name)
for line in nested_out:
output.append(' %s' % line)