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
(cherry picked from commit 78f0b81ece)
This commit is contained in:
Jooyung Han
2023-03-24 15:27:40 +09:00
committed by Kyle Zhang
parent bfa8d39a63
commit 81171a7e75

View File

@@ -104,13 +104,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",
}
// ----------------------------------------------------------------------------
@@ -131,10 +150,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"],
@@ -210,7 +229,7 @@ cc_library_static {
// ----------------------------------------------------------------------------
// Builds libwvaidl.so
//
cc_library_shared {
cc_library {
name: "libwvaidl",
srcs: [
@@ -237,28 +256,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"],