Add SCP support for Android files

SCP uses the JNI headers in generated code, so several targets need
the include path; this will have no effect on non-SCP builds.  Also,
in "protected" builds, there is a generated library that needs to be
linked in the final binary, but this doesn't exist in the "analysis"
step; we create an empty static library if it doesn't exist so it works
on all cases.

Merged from https://widevine-internal-review.googlesource.com/169850

Merged from https://widevine-internal-review.googlesource.com/176177

Bug: 262635528
Change-Id: Ib676d55efbcbec81de9c3123bc70afb570d6caa5
(cherry picked from commit b9482eb23c261788a4432de7566f1b1de1cf9379)
This commit is contained in:
Jacob Trimble
2023-04-03 17:55:19 +00:00
committed by Kyle Zhang
parent b30452a3f6
commit 95b50d39ba
4 changed files with 100 additions and 2 deletions

View File

@@ -220,6 +220,7 @@ cc_library_static {
],
header_libs: [
"jni_headers",
"libbase_headers",
"libutils_headers",
],
@@ -252,6 +253,82 @@ filegroup {
],
}
genrule {
name: "libscp_runtime_genrule_x86",
srcs: [
"copy_scp_runtime.sh",
],
out: [
"libscp_runtime_x86.a",
],
cmd: "$(in) libscp_runtime_x86.a $(out)",
}
genrule {
name: "libscp_runtime_genrule_x64",
srcs: [
"copy_scp_runtime.sh",
],
out: [
"libscp_runtime_x64.a",
],
cmd: "$(in) libscp_runtime_x86_64.a $(out)",
}
genrule {
name: "libscp_runtime_genrule_arm",
srcs: [
"copy_scp_runtime.sh",
],
out: [
"libscp_runtime_arm.a",
],
cmd: "$(in) libscp_runtime_armeabi-v7a.a $(out)",
}
genrule {
name: "libscp_runtime_genrule_arm64",
srcs: [
"copy_scp_runtime.sh",
],
out: [
"libscp_runtime_arm64.a",
],
cmd: "$(in) libscp_runtime_arm64-v8a.a $(out)",
}
cc_prebuilt_library_static {
name: "libscp_runtime",
vendor_available: true,
arch: {
x86: {
srcs: [
":libscp_runtime_genrule_x86",
],
},
x86_64: {
srcs: [
":libscp_runtime_genrule_x64",
],
},
arm: {
srcs: [
":libscp_runtime_genrule_arm",
],
},
arm64: {
srcs: [
":libscp_runtime_genrule_arm64",
],
},
},
}
// ----------------------------------------------------------------------------
// Builds libwvaidl.so
//
@@ -293,6 +370,7 @@ cc_library {
"libprotobuf-cpp-lite",
"libutils",
"libwv_odk",
"libscp_runtime",
"libwvdrmcryptoplugin_aidl",
"libwvdrmdrmplugin_aidl",
"libwvlevel3",
@@ -309,7 +387,10 @@ cc_library {
"wv_media_drm_flags_c_lib",
],
header_libs: ["libstagefright_foundation_headers"],
header_libs: [
"jni_headers",
"libstagefright_foundation_headers",
],
owner: "widevine",