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"], header_libs: ["libstagefright_foundation_headers"],
shared_libs: [ shared_libs: [
"android.hardware.drm-V1-ndk",
"libbase",
"libbinder_ndk", "libbinder_ndk",
"libcrypto",
"liblog", "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: [ shared_libs: [
"libbinder_ndk", "libbinder_ndk",
"libprotobuf-cpp-lite",
], ],
static_libs: [ static_libs: [
"lib_apex_manifest_minimal_proto_lite", "lib_apex_manifest_minimal_proto_lite",
"libprotobuf-cpp-lite",
], ],
init_rc: ["src/android.hardware.drm-service.widevine.rc"], init_rc: ["src/android.hardware.drm-service.widevine.rc"],
@@ -212,7 +231,7 @@ cc_library_static {
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// Builds libwvaidl.so // Builds libwvaidl.so
// //
cc_library_shared { cc_library {
name: "libwvaidl", name: "libwvaidl",
srcs: [ srcs: [
@@ -239,28 +258,28 @@ cc_library_shared {
static_libs: [ static_libs: [
"android.hardware.common-V2-ndk", "android.hardware.common-V2-ndk",
"android.hardware.drm-V1-ndk",
"libaidlcommonsupport", "libaidlcommonsupport",
"libcdm", "libbase",
"libcdm_protos", "libcdm_protos",
"libcdm_utils", "libcdm_utils",
"libcdm",
"libcutils",
"libjsmn", "libjsmn",
"libjsoncpp", "libjsoncpp",
"libprotobuf-cpp-lite",
"libutils",
"libwv_odk",
"libwvdrmcryptoplugin_aidl", "libwvdrmcryptoplugin_aidl",
"libwvdrmdrmplugin_aidl", "libwvdrmdrmplugin_aidl",
"libwvlevel3", "libwvlevel3",
"libwv_odk",
], ],
shared_libs: [ shared_libs: [
"android.hardware.drm-V1-ndk",
"libbase",
"libbinder_ndk", "libbinder_ndk",
"libcrypto", "libcrypto",
"libcutils",
"libdl", "libdl",
"liblog", "liblog",
"libprotobuf-cpp-lite",
"libutils",
], ],
header_libs: ["libstagefright_foundation_headers"], header_libs: ["libstagefright_foundation_headers"],