gn2bp: link libprotobuf statically
Test: //components/cronet/android:cronet
Change-Id: I2aedb0be30a34fa7a7bf613882ff8cbb0f0f7512
diff --git a/tools/gn2bp/gen_android_bp b/tools/gn2bp/gen_android_bp
index 2644e43..ed2f691 100755
--- a/tools/gn2bp/gen_android_bp
+++ b/tools/gn2bp/gen_android_bp
@@ -138,25 +138,18 @@
def enable_protobuf_full(module):
- if module.type == 'cc_binary_host':
+ if module.type not in ['genrule', 'filegroup']:
module.static_libs.add('libprotobuf-cpp-full')
- elif module.host_supported:
- module.host.static_libs.add('libprotobuf-cpp-full')
- module.android.shared_libs.add('libprotobuf-cpp-full')
- elif module.type not in ['genrule', 'filegroup']:
- module.shared_libs.add('libprotobuf-cpp-full')
def enable_protobuf_lite(module):
if module.type not in ['genrule', 'filegroup']:
- module.shared_libs.add('libprotobuf-cpp-lite')
+ module.static_libs.add('libprotobuf-cpp-lite')
def enable_protoc_lib(module):
- if module.type == 'cc_binary_host':
+ if module.type not in ['genrule', 'filegroup']:
module.static_libs.add('libprotoc')
- elif module.type not in ['genrule', 'filegroup']:
- module.shared_libs.add('libprotoc')
def enable_libunwindstack(module):