gn2bp: link libprotobuf statically
Test: //components/cronet/android:cronet
Change-Id: I2aedb0be30a34fa7a7bf613882ff8cbb0f0f7512
diff --git a/tools/gn2bp/Android.bp.swp b/tools/gn2bp/Android.bp.swp
index 376b8f1..35014b1 100644
--- a/tools/gn2bp/Android.bp.swp
+++ b/tools/gn2bp/Android.bp.swp
@@ -3487,6 +3487,7 @@
"cronet_aml_third_party_modp_b64_modp_b64",
"cronet_aml_third_party_zlib_zlib",
"cronet_aml_url_url",
+ "libprotobuf-cpp-lite",
],
generated_headers: [
"cronet_aml_base_debugging_buildflags",
@@ -4267,6 +4268,7 @@
"cronet_aml_third_party_modp_b64_modp_b64",
"cronet_aml_third_party_zlib_zlib",
"cronet_aml_url_url",
+ "libprotobuf-cpp-lite",
],
generated_headers: [
"cronet_aml_build_chromeos_buildflags",
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):