diff options
author | 2020-07-10 19:55:36 +0100 | |
---|---|---|
committer | 2020-07-17 14:32:15 +0100 | |
commit | 4cfa2c692b9c901afd3265ad34af3dd7b38576c7 (patch) | |
tree | 6d2c0fbde6c788f3e9b02b5a623b872494048fb5 /sdk/cc_sdk_test.go | |
parent | 89238f4703ddb44bdc963e26ca29fb9eed6b1b38 (diff) |
Set compile_multilib for SDK snapshots for device.
Previously compile_multilib was ignored for device and defaulted to
"both", which could lead to an internal inconsistency in the snapshot
if a member was 32- or 64-only.
This also implements common property optimisation for compile_multilib,
by adding a struct that can be extended to other properties in the
future.
Test: m nothing
Bug: 151303681
Change-Id: I3e96222858e5e755173aca03508a23c431977e2a
Diffstat (limited to 'sdk/cc_sdk_test.go')
-rw-r--r-- | sdk/cc_sdk_test.go | 38 |
1 files changed, 16 insertions, 22 deletions
diff --git a/sdk/cc_sdk_test.go b/sdk/cc_sdk_test.go index 497f14bde..17afdb804 100644 --- a/sdk/cc_sdk_test.go +++ b/sdk/cc_sdk_test.go @@ -73,7 +73,6 @@ func TestSdkCompileMultilibOverride(t *testing.T) { result := testSdkWithCc(t, ` sdk { name: "mysdk", - device_supported: false, host_supported: true, native_shared_libs: ["sdkmember"], compile_multilib: "64", @@ -81,7 +80,6 @@ func TestSdkCompileMultilibOverride(t *testing.T) { cc_library_shared { name: "sdkmember", - device_supported: false, host_supported: true, srcs: ["Test.cpp"], stl: "none", @@ -96,14 +94,16 @@ func TestSdkCompileMultilibOverride(t *testing.T) { cc_prebuilt_library_shared { name: "mysdk_sdkmember@current", sdk_member_name: "sdkmember", - device_supported: false, host_supported: true, installable: false, stl: "none", compile_multilib: "64", - arch: { - x86_64: { - srcs: ["x86_64/lib/sdkmember.so"], + target: { + android_arm64: { + srcs: ["android/arm64/lib/sdkmember.so"], + }, + linux_glibc_x86_64: { + srcs: ["linux_glibc/x86_64/lib/sdkmember.so"], }, }, } @@ -111,31 +111,29 @@ cc_prebuilt_library_shared { cc_prebuilt_library_shared { name: "sdkmember", prefer: false, - device_supported: false, host_supported: true, stl: "none", compile_multilib: "64", - arch: { - x86_64: { - srcs: ["x86_64/lib/sdkmember.so"], + target: { + android_arm64: { + srcs: ["android/arm64/lib/sdkmember.so"], + }, + linux_glibc_x86_64: { + srcs: ["linux_glibc/x86_64/lib/sdkmember.so"], }, }, } sdk_snapshot { name: "mysdk@current", - device_supported: false, host_supported: true, native_shared_libs: ["mysdk_sdkmember@current"], - target: { - linux_glibc: { - compile_multilib: "64", - }, - }, + compile_multilib: "64", } `), checkAllCopyRules(` -.intermediates/sdkmember/linux_glibc_x86_64_shared/sdkmember.so -> x86_64/lib/sdkmember.so +.intermediates/sdkmember/android_arm64_armv8-a_shared/sdkmember.so -> android/arm64/lib/sdkmember.so +.intermediates/sdkmember/linux_glibc_x86_64_shared/sdkmember.so -> linux_glibc/x86_64/lib/sdkmember.so `)) } @@ -1527,11 +1525,7 @@ module_exports_snapshot { device_supported: false, host_supported: true, native_static_libs: ["myexports_mynativelib@current"], - target: { - linux_glibc: { - compile_multilib: "64", - }, - }, + compile_multilib: "64", }`), checkAllCopyRules(` include/Test.h -> include/include/Test.h |