Link dependencies statically

This reduces the APEX size from 6754304 to 4378624.

Bug: 274818387
Test: m com.google.android.widevine
Test: adb install $OUT/vendor/apex/com.google.android.widevine.apex
Test: adb reboot
Change-Id: Ib31291e5ee35297b9d85120f5eca118ebf10f55f
This commit is contained in:
Jooyung Han
2023-03-24 15:27:40 +09:00
parent 75235e430e
commit 78f0b81ece

View File

@@ -105,13 +105,32 @@ cc_defaults {
header_libs: ["libstagefright_foundation_headers"],
shared_libs: [
"android.hardware.drm-V1-ndk",
"libbase",
"libbinder_ndk",
"libcrypto",
"liblog",
"libutils",
"libwvaidl",
],
static_libs: [
"android.hardware.common-V2-ndk",
"android.hardware.drm-V1-ndk",
"libaidlcommonsupport",
"libbase",
"libcdm_protos",
"libcdm_utils",
"libcdm",
"libcutils",
"libjsmn",
"libjsoncpp",
"libprotobuf-cpp-lite",
"libutils",
"libwv_odk",
"libwvaidl",
"libwvdrmcryptoplugin_aidl",
"libwvdrmdrmplugin_aidl",
"libwvlevel3",
],
stl: "c++_static",
}
// ----------------------------------------------------------------------------
@@ -132,10 +151,10 @@ cc_binary {
shared_libs: [
"libbinder_ndk",
"libprotobuf-cpp-lite",
],
static_libs: [
"lib_apex_manifest_minimal_proto_lite",
"libprotobuf-cpp-lite",
],
init_rc: ["src/android.hardware.drm-service.widevine.rc"],
@@ -212,7 +231,7 @@ cc_library_static {
// ----------------------------------------------------------------------------
// Builds libwvaidl.so
//
cc_library_shared {
cc_library {
name: "libwvaidl",
srcs: [
@@ -239,28 +258,28 @@ cc_library_shared {
static_libs: [
"android.hardware.common-V2-ndk",
"android.hardware.drm-V1-ndk",
"libaidlcommonsupport",
"libcdm",
"libbase",
"libcdm_protos",
"libcdm_utils",
"libcdm",
"libcutils",
"libjsmn",
"libjsoncpp",
"libprotobuf-cpp-lite",
"libutils",
"libwv_odk",
"libwvdrmcryptoplugin_aidl",
"libwvdrmdrmplugin_aidl",
"libwvlevel3",
"libwv_odk",
],
shared_libs: [
"android.hardware.drm-V1-ndk",
"libbase",
"libbinder_ndk",
"libcrypto",
"libcutils",
"libdl",
"liblog",
"libprotobuf-cpp-lite",
"libutils",
],
header_libs: ["libstagefright_foundation_headers"],