summaryrefslogtreecommitdiff
path: root/sdk/cc_sdk_test.go
diff options
context:
space:
mode:
authorMartin Stjernholm <mast@google.com>2020-06-17 22:52:25 +0100
committerMartin Stjernholm <mast@google.com>2020-06-17 23:06:43 +0100
commit47ed352227b526fd366d1cd9a829357a23794958 (patch)
treed9fa22ef629b6c9750b639ef6ab837296e17ba31 /sdk/cc_sdk_test.go
parentd7ffbb578db68b884cae8d4c2faffcc6211511d6 (diff)
Propagate unique_host_soname to cc_library prebuilts.
Test: m nothing Test: Check on go/Android.bp that cc_prebuilt_library supports unique_host_soname Bug: 158743135 Change-Id: Ie02a5cae057fb9092c226d8c5b7f63e1f66ad066
Diffstat (limited to 'sdk/cc_sdk_test.go')
-rw-r--r--sdk/cc_sdk_test.go80
1 files changed, 80 insertions, 0 deletions
diff --git a/sdk/cc_sdk_test.go b/sdk/cc_sdk_test.go
index 4a090814d..123fe7069 100644
--- a/sdk/cc_sdk_test.go
+++ b/sdk/cc_sdk_test.go
@@ -1976,3 +1976,83 @@ sdk_snapshot {
}
`))
}
+
+func TestUniqueHostSoname(t *testing.T) {
+ // b/145598135 - Generating host snapshots for anything other than linux is not supported.
+ SkipIfNotLinux(t)
+
+ result := testSdkWithCc(t, `
+ sdk {
+ name: "mysdk",
+ host_supported: true,
+ native_shared_libs: ["mylib"],
+ }
+
+ cc_library {
+ name: "mylib",
+ host_supported: true,
+ unique_host_soname: true,
+ }
+ `)
+
+ result.CheckSnapshot("mysdk", "",
+ checkAndroidBpContents(`
+// This is auto-generated. DO NOT EDIT.
+
+cc_prebuilt_library_shared {
+ name: "mysdk_mylib@current",
+ sdk_member_name: "mylib",
+ host_supported: true,
+ installable: false,
+ unique_host_soname: true,
+ target: {
+ android_arm64: {
+ srcs: ["android/arm64/lib/mylib.so"],
+ },
+ android_arm: {
+ srcs: ["android/arm/lib/mylib.so"],
+ },
+ linux_glibc_x86_64: {
+ srcs: ["linux_glibc/x86_64/lib/mylib-host.so"],
+ },
+ linux_glibc_x86: {
+ srcs: ["linux_glibc/x86/lib/mylib-host.so"],
+ },
+ },
+}
+
+cc_prebuilt_library_shared {
+ name: "mylib",
+ prefer: false,
+ host_supported: true,
+ unique_host_soname: true,
+ target: {
+ android_arm64: {
+ srcs: ["android/arm64/lib/mylib.so"],
+ },
+ android_arm: {
+ srcs: ["android/arm/lib/mylib.so"],
+ },
+ linux_glibc_x86_64: {
+ srcs: ["linux_glibc/x86_64/lib/mylib-host.so"],
+ },
+ linux_glibc_x86: {
+ srcs: ["linux_glibc/x86/lib/mylib-host.so"],
+ },
+ },
+}
+
+sdk_snapshot {
+ name: "mysdk@current",
+ host_supported: true,
+ native_shared_libs: ["mysdk_mylib@current"],
+}
+`),
+ checkAllCopyRules(`
+.intermediates/mylib/android_arm64_armv8-a_shared/mylib.so -> android/arm64/lib/mylib.so
+.intermediates/mylib/android_arm_armv7-a-neon_shared/mylib.so -> android/arm/lib/mylib.so
+.intermediates/mylib/linux_glibc_x86_64_shared/mylib-host.so -> linux_glibc/x86_64/lib/mylib-host.so
+.intermediates/mylib/linux_glibc_x86_shared/mylib-host.so -> linux_glibc/x86/lib/mylib-host.so
+`),
+ )
+}