blob: eb64bcc16825eee6e17f480e48f31ed7db77e989 [file] [log] [blame]
Paul Duffina80fdec2019-12-03 15:25:00 +00001// Copyright (C) 2019 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15package sdk
16
17import (
18 "testing"
19
Paul Duffin1356d8c2020-02-25 19:26:33 +000020 "android/soong/android"
Paul Duffina80fdec2019-12-03 15:25:00 +000021 "android/soong/cc"
22)
23
Paul Duffind835daa2019-11-30 17:49:09 +000024func testSdkWithCc(t *testing.T, bp string) *testSdkResult {
25 t.Helper()
26
27 fs := map[string][]byte{
Paul Duffina04c1072020-03-02 10:16:35 +000028 "Test.cpp": nil,
29 "include/Test.h": nil,
30 "include-android/AndroidTest.h": nil,
31 "include-host/HostTest.h": nil,
32 "arm64/include/Arm64Test.h": nil,
33 "libfoo.so": nil,
34 "aidl/foo/bar/Test.aidl": nil,
Paul Duffind835daa2019-11-30 17:49:09 +000035 }
36 return testSdkWithFs(t, bp, fs)
37}
38
Paul Duffina80fdec2019-12-03 15:25:00 +000039// Contains tests for SDK members provided by the cc package.
40
41func TestSdkIsCompileMultilibBoth(t *testing.T) {
Paul Duffind835daa2019-11-30 17:49:09 +000042 result := testSdkWithCc(t, `
Paul Duffina80fdec2019-12-03 15:25:00 +000043 sdk {
44 name: "mysdk",
45 native_shared_libs: ["sdkmember"],
46 }
47
48 cc_library_shared {
49 name: "sdkmember",
50 srcs: ["Test.cpp"],
Paul Duffina80fdec2019-12-03 15:25:00 +000051 stl: "none",
52 }
53 `)
54
Colin Cross7113d202019-11-20 16:39:12 -080055 armOutput := result.Module("sdkmember", "android_arm_armv7-a-neon_shared").(*cc.Module).OutputFile()
56 arm64Output := result.Module("sdkmember", "android_arm64_armv8-a_shared").(*cc.Module).OutputFile()
Paul Duffina80fdec2019-12-03 15:25:00 +000057
58 var inputs []string
Paul Duffin1356d8c2020-02-25 19:26:33 +000059 buildParams := result.Module("mysdk", android.CommonOS.Name).BuildParamsForTests()
Paul Duffina80fdec2019-12-03 15:25:00 +000060 for _, bp := range buildParams {
61 if bp.Input != nil {
62 inputs = append(inputs, bp.Input.String())
63 }
64 }
65
66 // ensure that both 32/64 outputs are inputs of the sdk snapshot
67 ensureListContains(t, inputs, armOutput.String())
68 ensureListContains(t, inputs, arm64Output.String())
69}
70
71func TestBasicSdkWithCc(t *testing.T) {
Paul Duffind835daa2019-11-30 17:49:09 +000072 result := testSdkWithCc(t, `
Paul Duffina80fdec2019-12-03 15:25:00 +000073 sdk {
74 name: "mysdk",
75 native_shared_libs: ["sdkmember"],
76 }
77
Paul Duffina0843f62019-12-13 19:50:38 +000078 cc_library_shared {
79 name: "sdkmember",
Colin Crossf9aabd72020-02-15 11:29:50 -080080 system_shared_libs: [],
Paul Duffina0843f62019-12-13 19:50:38 +000081 }
82
Paul Duffina80fdec2019-12-03 15:25:00 +000083 sdk_snapshot {
84 name: "mysdk@1",
85 native_shared_libs: ["sdkmember_mysdk_1"],
86 }
87
88 sdk_snapshot {
89 name: "mysdk@2",
90 native_shared_libs: ["sdkmember_mysdk_2"],
91 }
92
93 cc_prebuilt_library_shared {
94 name: "sdkmember",
95 srcs: ["libfoo.so"],
96 prefer: false,
97 system_shared_libs: [],
98 stl: "none",
99 }
100
101 cc_prebuilt_library_shared {
102 name: "sdkmember_mysdk_1",
103 sdk_member_name: "sdkmember",
104 srcs: ["libfoo.so"],
105 system_shared_libs: [],
106 stl: "none",
Anton Hanssoneec79eb2020-01-10 15:12:39 +0000107 // TODO: remove //apex_available:platform
108 apex_available: [
109 "//apex_available:platform",
110 "myapex",
111 ],
Paul Duffina80fdec2019-12-03 15:25:00 +0000112 }
113
114 cc_prebuilt_library_shared {
115 name: "sdkmember_mysdk_2",
116 sdk_member_name: "sdkmember",
117 srcs: ["libfoo.so"],
118 system_shared_libs: [],
119 stl: "none",
Anton Hanssoneec79eb2020-01-10 15:12:39 +0000120 // TODO: remove //apex_available:platform
121 apex_available: [
122 "//apex_available:platform",
123 "myapex2",
124 ],
Paul Duffina80fdec2019-12-03 15:25:00 +0000125 }
126
127 cc_library_shared {
128 name: "mycpplib",
129 srcs: ["Test.cpp"],
130 shared_libs: ["sdkmember"],
131 system_shared_libs: [],
132 stl: "none",
Anton Hanssoneec79eb2020-01-10 15:12:39 +0000133 apex_available: [
134 "myapex",
135 "myapex2",
136 ],
Paul Duffina80fdec2019-12-03 15:25:00 +0000137 }
138
139 apex {
140 name: "myapex",
141 native_shared_libs: ["mycpplib"],
142 uses_sdks: ["mysdk@1"],
143 key: "myapex.key",
144 certificate: ":myapex.cert",
145 }
146
147 apex {
148 name: "myapex2",
149 native_shared_libs: ["mycpplib"],
150 uses_sdks: ["mysdk@2"],
151 key: "myapex.key",
152 certificate: ":myapex.cert",
153 }
154 `)
155
Colin Cross7113d202019-11-20 16:39:12 -0800156 sdkMemberV1 := result.ModuleForTests("sdkmember_mysdk_1", "android_arm64_armv8-a_shared_myapex").Rule("toc").Output
157 sdkMemberV2 := result.ModuleForTests("sdkmember_mysdk_2", "android_arm64_armv8-a_shared_myapex2").Rule("toc").Output
Paul Duffina80fdec2019-12-03 15:25:00 +0000158
Colin Cross7113d202019-11-20 16:39:12 -0800159 cpplibForMyApex := result.ModuleForTests("mycpplib", "android_arm64_armv8-a_shared_myapex")
160 cpplibForMyApex2 := result.ModuleForTests("mycpplib", "android_arm64_armv8-a_shared_myapex2")
Paul Duffina80fdec2019-12-03 15:25:00 +0000161
162 // Depending on the uses_sdks value, different libs are linked
163 ensureListContains(t, pathsToStrings(cpplibForMyApex.Rule("ld").Implicits), sdkMemberV1.String())
164 ensureListContains(t, pathsToStrings(cpplibForMyApex2.Rule("ld").Implicits), sdkMemberV2.String())
165}
166
Paul Duffina0843f62019-12-13 19:50:38 +0000167// Make sure the sdk can use host specific cc libraries static/shared and both.
168func TestHostSdkWithCc(t *testing.T) {
169 testSdkWithCc(t, `
170 sdk {
171 name: "mysdk",
172 device_supported: false,
173 host_supported: true,
174 native_shared_libs: ["sdkshared"],
175 native_static_libs: ["sdkstatic"],
176 }
177
178 cc_library_host_shared {
179 name: "sdkshared",
Paul Duffina0843f62019-12-13 19:50:38 +0000180 stl: "none",
181 }
182
183 cc_library_host_static {
184 name: "sdkstatic",
Paul Duffina0843f62019-12-13 19:50:38 +0000185 stl: "none",
186 }
187 `)
188}
189
190// Make sure the sdk can use cc libraries static/shared and both.
191func TestSdkWithCc(t *testing.T) {
192 testSdkWithCc(t, `
193 sdk {
194 name: "mysdk",
195 native_shared_libs: ["sdkshared", "sdkboth1"],
196 native_static_libs: ["sdkstatic", "sdkboth2"],
197 }
198
199 cc_library_shared {
200 name: "sdkshared",
Paul Duffina0843f62019-12-13 19:50:38 +0000201 stl: "none",
202 }
203
204 cc_library_static {
205 name: "sdkstatic",
Paul Duffina0843f62019-12-13 19:50:38 +0000206 stl: "none",
207 }
208
209 cc_library {
210 name: "sdkboth1",
Paul Duffina0843f62019-12-13 19:50:38 +0000211 stl: "none",
212 }
213
214 cc_library {
215 name: "sdkboth2",
Paul Duffina0843f62019-12-13 19:50:38 +0000216 stl: "none",
217 }
218 `)
219}
220
Martin Stjernholmcd07bce2020-03-10 22:37:59 +0000221func TestSnapshotWithObject(t *testing.T) {
222 result := testSdkWithCc(t, `
223 sdk {
224 name: "mysdk",
225 native_objects: ["crtobj"],
226 }
227
228 cc_object {
229 name: "crtobj",
230 stl: "none",
231 }
232 `)
233
234 result.CheckSnapshot("mysdk", "",
235 checkAndroidBpContents(`
236// This is auto-generated. DO NOT EDIT.
237
238cc_prebuilt_object {
239 name: "mysdk_crtobj@current",
240 sdk_member_name: "crtobj",
241 stl: "none",
242 arch: {
243 arm64: {
244 srcs: ["arm64/lib/crtobj.o"],
245 },
246 arm: {
247 srcs: ["arm/lib/crtobj.o"],
248 },
249 },
250}
251
252cc_prebuilt_object {
253 name: "crtobj",
254 prefer: false,
255 stl: "none",
256 arch: {
257 arm64: {
258 srcs: ["arm64/lib/crtobj.o"],
259 },
260 arm: {
261 srcs: ["arm/lib/crtobj.o"],
262 },
263 },
264}
265
266sdk_snapshot {
267 name: "mysdk@current",
268 native_objects: ["mysdk_crtobj@current"],
269}
270`),
271 checkAllCopyRules(`
272.intermediates/crtobj/android_arm64_armv8-a/crtobj.o -> arm64/lib/crtobj.o
273.intermediates/crtobj/android_arm_armv7-a-neon/crtobj.o -> arm/lib/crtobj.o
274`),
275 )
276}
277
Paul Duffinc62a5102019-12-11 18:34:15 +0000278func TestSnapshotWithCcDuplicateHeaders(t *testing.T) {
279 result := testSdkWithCc(t, `
280 sdk {
281 name: "mysdk",
282 native_shared_libs: ["mynativelib1", "mynativelib2"],
283 }
284
285 cc_library_shared {
286 name: "mynativelib1",
287 srcs: [
288 "Test.cpp",
289 ],
290 export_include_dirs: ["include"],
Paul Duffinc62a5102019-12-11 18:34:15 +0000291 stl: "none",
292 }
293
294 cc_library_shared {
295 name: "mynativelib2",
296 srcs: [
297 "Test.cpp",
298 ],
299 export_include_dirs: ["include"],
Paul Duffinc62a5102019-12-11 18:34:15 +0000300 stl: "none",
301 }
302 `)
303
Paul Duffin1356d8c2020-02-25 19:26:33 +0000304 result.CheckSnapshot("mysdk", "",
Paul Duffinc62a5102019-12-11 18:34:15 +0000305 checkAllCopyRules(`
306include/Test.h -> include/include/Test.h
Colin Cross7113d202019-11-20 16:39:12 -0800307.intermediates/mynativelib1/android_arm64_armv8-a_shared/mynativelib1.so -> arm64/lib/mynativelib1.so
308.intermediates/mynativelib1/android_arm_armv7-a-neon_shared/mynativelib1.so -> arm/lib/mynativelib1.so
309.intermediates/mynativelib2/android_arm64_armv8-a_shared/mynativelib2.so -> arm64/lib/mynativelib2.so
310.intermediates/mynativelib2/android_arm_armv7-a-neon_shared/mynativelib2.so -> arm/lib/mynativelib2.so
Paul Duffinc62a5102019-12-11 18:34:15 +0000311`),
312 )
313}
314
Paul Duffina7cd8c82019-12-11 20:00:57 +0000315// Verify that when the shared library has some common and some arch specific properties that the generated
316// snapshot is optimized properly.
317func TestSnapshotWithCcSharedLibraryCommonProperties(t *testing.T) {
318 result := testSdkWithCc(t, `
319 sdk {
320 name: "mysdk",
321 native_shared_libs: ["mynativelib"],
322 }
323
324 cc_library_shared {
325 name: "mynativelib",
326 srcs: [
327 "Test.cpp",
328 "aidl/foo/bar/Test.aidl",
329 ],
330 export_include_dirs: ["include"],
331 arch: {
332 arm64: {
333 export_system_include_dirs: ["arm64/include"],
334 },
335 },
Paul Duffina7cd8c82019-12-11 20:00:57 +0000336 stl: "none",
337 }
338 `)
339
Paul Duffin1356d8c2020-02-25 19:26:33 +0000340 result.CheckSnapshot("mysdk", "",
Paul Duffina7cd8c82019-12-11 20:00:57 +0000341 checkAndroidBpContents(`
342// This is auto-generated. DO NOT EDIT.
343
344cc_prebuilt_library_shared {
345 name: "mysdk_mynativelib@current",
346 sdk_member_name: "mynativelib",
Paul Duffin0cb37b92020-03-04 14:52:46 +0000347 installable: false,
Paul Duffin0174d8d2020-03-11 18:42:08 +0000348 stl: "none",
Paul Duffina7cd8c82019-12-11 20:00:57 +0000349 export_include_dirs: ["include/include"],
350 arch: {
351 arm64: {
352 srcs: ["arm64/lib/mynativelib.so"],
353 export_system_include_dirs: ["arm64/include/arm64/include"],
354 },
355 arm: {
356 srcs: ["arm/lib/mynativelib.so"],
357 },
358 },
Paul Duffina7cd8c82019-12-11 20:00:57 +0000359}
360
361cc_prebuilt_library_shared {
362 name: "mynativelib",
363 prefer: false,
Paul Duffin0174d8d2020-03-11 18:42:08 +0000364 stl: "none",
Paul Duffina7cd8c82019-12-11 20:00:57 +0000365 export_include_dirs: ["include/include"],
366 arch: {
367 arm64: {
368 srcs: ["arm64/lib/mynativelib.so"],
369 export_system_include_dirs: ["arm64/include/arm64/include"],
370 },
371 arm: {
372 srcs: ["arm/lib/mynativelib.so"],
373 },
374 },
Paul Duffina7cd8c82019-12-11 20:00:57 +0000375}
376
377sdk_snapshot {
378 name: "mysdk@current",
379 native_shared_libs: ["mysdk_mynativelib@current"],
380}
381`),
382 checkAllCopyRules(`
383include/Test.h -> include/include/Test.h
Colin Cross7113d202019-11-20 16:39:12 -0800384.intermediates/mynativelib/android_arm64_armv8-a_shared/mynativelib.so -> arm64/lib/mynativelib.so
Paul Duffina7cd8c82019-12-11 20:00:57 +0000385arm64/include/Arm64Test.h -> arm64/include/arm64/include/Arm64Test.h
Colin Cross7113d202019-11-20 16:39:12 -0800386.intermediates/mynativelib/android_arm_armv7-a-neon_shared/mynativelib.so -> arm/lib/mynativelib.so`),
Paul Duffina7cd8c82019-12-11 20:00:57 +0000387 )
388}
389
Paul Duffin25ce04b2020-01-16 11:47:25 +0000390func TestSnapshotWithCcBinary(t *testing.T) {
391 result := testSdkWithCc(t, `
392 module_exports {
393 name: "mymodule_exports",
394 native_binaries: ["mynativebinary"],
395 }
396
397 cc_binary {
398 name: "mynativebinary",
399 srcs: [
400 "Test.cpp",
401 ],
402 compile_multilib: "both",
Paul Duffin25ce04b2020-01-16 11:47:25 +0000403 stl: "none",
404 }
405 `)
406
Paul Duffin1356d8c2020-02-25 19:26:33 +0000407 result.CheckSnapshot("mymodule_exports", "",
Paul Duffin25ce04b2020-01-16 11:47:25 +0000408 checkAndroidBpContents(`
409// This is auto-generated. DO NOT EDIT.
410
411cc_prebuilt_binary {
412 name: "mymodule_exports_mynativebinary@current",
413 sdk_member_name: "mynativebinary",
Paul Duffin0cb37b92020-03-04 14:52:46 +0000414 installable: false,
Paul Duffin25ce04b2020-01-16 11:47:25 +0000415 compile_multilib: "both",
416 arch: {
417 arm64: {
418 srcs: ["arm64/bin/mynativebinary"],
419 },
420 arm: {
421 srcs: ["arm/bin/mynativebinary"],
422 },
423 },
424}
425
426cc_prebuilt_binary {
427 name: "mynativebinary",
428 prefer: false,
429 compile_multilib: "both",
430 arch: {
431 arm64: {
432 srcs: ["arm64/bin/mynativebinary"],
433 },
434 arm: {
435 srcs: ["arm/bin/mynativebinary"],
436 },
437 },
438}
439
440module_exports_snapshot {
441 name: "mymodule_exports@current",
442 native_binaries: ["mymodule_exports_mynativebinary@current"],
443}
444`),
445 checkAllCopyRules(`
446.intermediates/mynativebinary/android_arm64_armv8-a/mynativebinary -> arm64/bin/mynativebinary
447.intermediates/mynativebinary/android_arm_armv7-a-neon/mynativebinary -> arm/bin/mynativebinary
448`),
449 )
450}
451
Paul Duffina04c1072020-03-02 10:16:35 +0000452func TestMultipleHostOsTypesSnapshotWithCcBinary(t *testing.T) {
453 // b/145598135 - Generating host snapshots for anything other than linux is not supported.
454 SkipIfNotLinux(t)
455
456 result := testSdkWithCc(t, `
457 module_exports {
458 name: "myexports",
459 device_supported: false,
460 host_supported: true,
461 native_binaries: ["mynativebinary"],
462 target: {
463 windows: {
464 enabled: true,
465 },
466 },
467 }
468
469 cc_binary {
470 name: "mynativebinary",
471 device_supported: false,
472 host_supported: true,
473 srcs: [
474 "Test.cpp",
475 ],
476 compile_multilib: "both",
Paul Duffina04c1072020-03-02 10:16:35 +0000477 stl: "none",
478 target: {
479 windows: {
480 enabled: true,
481 },
482 },
483 }
484 `)
485
486 result.CheckSnapshot("myexports", "",
487 checkAndroidBpContents(`
488// This is auto-generated. DO NOT EDIT.
489
490cc_prebuilt_binary {
491 name: "myexports_mynativebinary@current",
492 sdk_member_name: "mynativebinary",
493 device_supported: false,
494 host_supported: true,
Paul Duffin0cb37b92020-03-04 14:52:46 +0000495 installable: false,
Paul Duffina04c1072020-03-02 10:16:35 +0000496 target: {
497 linux_glibc: {
498 compile_multilib: "both",
499 },
500 linux_glibc_x86_64: {
501 srcs: ["linux_glibc/x86_64/bin/mynativebinary"],
502 },
503 linux_glibc_x86: {
504 srcs: ["linux_glibc/x86/bin/mynativebinary"],
505 },
506 windows: {
507 compile_multilib: "64",
508 },
509 windows_x86_64: {
510 srcs: ["windows/x86_64/bin/mynativebinary.exe"],
511 },
512 },
513}
514
515cc_prebuilt_binary {
516 name: "mynativebinary",
517 prefer: false,
518 device_supported: false,
519 host_supported: true,
520 target: {
521 linux_glibc: {
522 compile_multilib: "both",
523 },
524 linux_glibc_x86_64: {
525 srcs: ["linux_glibc/x86_64/bin/mynativebinary"],
526 },
527 linux_glibc_x86: {
528 srcs: ["linux_glibc/x86/bin/mynativebinary"],
529 },
530 windows: {
531 compile_multilib: "64",
532 },
533 windows_x86_64: {
534 srcs: ["windows/x86_64/bin/mynativebinary.exe"],
535 },
536 },
537}
538
539module_exports_snapshot {
540 name: "myexports@current",
541 device_supported: false,
542 host_supported: true,
543 native_binaries: ["myexports_mynativebinary@current"],
Paul Duffin6a7e9532020-03-20 17:50:07 +0000544 target: {
545 windows: {
546 compile_multilib: "64",
547 },
548 },
Paul Duffina04c1072020-03-02 10:16:35 +0000549}
550`),
551 checkAllCopyRules(`
552.intermediates/mynativebinary/linux_glibc_x86_64/mynativebinary -> linux_glibc/x86_64/bin/mynativebinary
553.intermediates/mynativebinary/linux_glibc_x86/mynativebinary -> linux_glibc/x86/bin/mynativebinary
554.intermediates/mynativebinary/windows_x86_64/mynativebinary.exe -> windows/x86_64/bin/mynativebinary.exe
555`),
556 )
557}
558
Paul Duffin9ab556f2019-12-11 18:42:17 +0000559func TestSnapshotWithCcSharedLibrary(t *testing.T) {
Paul Duffind835daa2019-11-30 17:49:09 +0000560 result := testSdkWithCc(t, `
Paul Duffina80fdec2019-12-03 15:25:00 +0000561 sdk {
562 name: "mysdk",
563 native_shared_libs: ["mynativelib"],
564 }
565
566 cc_library_shared {
567 name: "mynativelib",
568 srcs: [
569 "Test.cpp",
570 "aidl/foo/bar/Test.aidl",
571 ],
Paul Duffinbefa4b92020-03-04 14:22:45 +0000572 apex_available: ["apex1", "apex2"],
Paul Duffina80fdec2019-12-03 15:25:00 +0000573 export_include_dirs: ["include"],
574 aidl: {
575 export_aidl_headers: true,
576 },
Paul Duffina80fdec2019-12-03 15:25:00 +0000577 stl: "none",
578 }
579 `)
580
Paul Duffin1356d8c2020-02-25 19:26:33 +0000581 result.CheckSnapshot("mysdk", "",
Paul Duffina80fdec2019-12-03 15:25:00 +0000582 checkAndroidBpContents(`
583// This is auto-generated. DO NOT EDIT.
584
585cc_prebuilt_library_shared {
586 name: "mysdk_mynativelib@current",
587 sdk_member_name: "mynativelib",
Paul Duffinbefa4b92020-03-04 14:22:45 +0000588 apex_available: [
589 "apex1",
590 "apex2",
591 ],
Paul Duffin0cb37b92020-03-04 14:52:46 +0000592 installable: false,
Paul Duffin0174d8d2020-03-11 18:42:08 +0000593 stl: "none",
Paul Duffin57b9e1d2019-12-13 00:03:35 +0000594 export_include_dirs: ["include/include"],
Paul Duffina80fdec2019-12-03 15:25:00 +0000595 arch: {
596 arm64: {
597 srcs: ["arm64/lib/mynativelib.so"],
Paul Duffin57b9e1d2019-12-13 00:03:35 +0000598 export_include_dirs: ["arm64/include_gen/mynativelib"],
Paul Duffina80fdec2019-12-03 15:25:00 +0000599 },
600 arm: {
601 srcs: ["arm/lib/mynativelib.so"],
Paul Duffin57b9e1d2019-12-13 00:03:35 +0000602 export_include_dirs: ["arm/include_gen/mynativelib"],
Paul Duffina80fdec2019-12-03 15:25:00 +0000603 },
604 },
Paul Duffina80fdec2019-12-03 15:25:00 +0000605}
606
607cc_prebuilt_library_shared {
608 name: "mynativelib",
609 prefer: false,
Paul Duffinbefa4b92020-03-04 14:22:45 +0000610 apex_available: [
611 "apex1",
612 "apex2",
613 ],
Paul Duffin0174d8d2020-03-11 18:42:08 +0000614 stl: "none",
Paul Duffin57b9e1d2019-12-13 00:03:35 +0000615 export_include_dirs: ["include/include"],
Paul Duffina80fdec2019-12-03 15:25:00 +0000616 arch: {
617 arm64: {
618 srcs: ["arm64/lib/mynativelib.so"],
Paul Duffin57b9e1d2019-12-13 00:03:35 +0000619 export_include_dirs: ["arm64/include_gen/mynativelib"],
Paul Duffina80fdec2019-12-03 15:25:00 +0000620 },
621 arm: {
622 srcs: ["arm/lib/mynativelib.so"],
Paul Duffin57b9e1d2019-12-13 00:03:35 +0000623 export_include_dirs: ["arm/include_gen/mynativelib"],
Paul Duffina80fdec2019-12-03 15:25:00 +0000624 },
625 },
Paul Duffina80fdec2019-12-03 15:25:00 +0000626}
627
628sdk_snapshot {
629 name: "mysdk@current",
630 native_shared_libs: ["mysdk_mynativelib@current"],
631}
632`),
633 checkAllCopyRules(`
Paul Duffin57b9e1d2019-12-13 00:03:35 +0000634include/Test.h -> include/include/Test.h
Colin Cross7113d202019-11-20 16:39:12 -0800635.intermediates/mynativelib/android_arm64_armv8-a_shared/mynativelib.so -> arm64/lib/mynativelib.so
636.intermediates/mynativelib/android_arm64_armv8-a_shared/gen/aidl/aidl/foo/bar/Test.h -> arm64/include_gen/mynativelib/aidl/foo/bar/Test.h
637.intermediates/mynativelib/android_arm64_armv8-a_shared/gen/aidl/aidl/foo/bar/BnTest.h -> arm64/include_gen/mynativelib/aidl/foo/bar/BnTest.h
638.intermediates/mynativelib/android_arm64_armv8-a_shared/gen/aidl/aidl/foo/bar/BpTest.h -> arm64/include_gen/mynativelib/aidl/foo/bar/BpTest.h
639.intermediates/mynativelib/android_arm_armv7-a-neon_shared/mynativelib.so -> arm/lib/mynativelib.so
640.intermediates/mynativelib/android_arm_armv7-a-neon_shared/gen/aidl/aidl/foo/bar/Test.h -> arm/include_gen/mynativelib/aidl/foo/bar/Test.h
641.intermediates/mynativelib/android_arm_armv7-a-neon_shared/gen/aidl/aidl/foo/bar/BnTest.h -> arm/include_gen/mynativelib/aidl/foo/bar/BnTest.h
642.intermediates/mynativelib/android_arm_armv7-a-neon_shared/gen/aidl/aidl/foo/bar/BpTest.h -> arm/include_gen/mynativelib/aidl/foo/bar/BpTest.h
Paul Duffina80fdec2019-12-03 15:25:00 +0000643`),
644 )
645}
646
Paul Duffin13f02712020-03-06 12:30:43 +0000647func TestSnapshotWithCcSharedLibrarySharedLibs(t *testing.T) {
648 result := testSdkWithCc(t, `
649 sdk {
650 name: "mysdk",
651 native_shared_libs: [
652 "mynativelib",
653 "myothernativelib",
654 "mysystemnativelib",
655 ],
656 }
657
658 cc_library {
659 name: "mysystemnativelib",
660 srcs: [
661 "Test.cpp",
662 ],
Paul Duffin13f02712020-03-06 12:30:43 +0000663 stl: "none",
664 }
665
666 cc_library_shared {
667 name: "myothernativelib",
668 srcs: [
669 "Test.cpp",
670 ],
671 system_shared_libs: [
672 // A reference to a library that is not an sdk member. Uses libm as that
673 // is in the default set of modules available to this test and so is available
674 // both here and also when the generated Android.bp file is tested in
675 // CheckSnapshot(). This ensures that the system_shared_libs property correctly
676 // handles references to modules that are not sdk members.
677 "libm",
678 ],
679 stl: "none",
680 }
681
682 cc_library {
683 name: "mynativelib",
684 srcs: [
685 "Test.cpp",
686 ],
687 shared_libs: [
688 // A reference to another sdk member.
689 "myothernativelib",
690 ],
691 target: {
692 android: {
693 shared: {
694 shared_libs: [
695 // A reference to a library that is not an sdk member. The libc library
696 // is used here to check that the shared_libs property is handled correctly
697 // in a similar way to how libm is used to check system_shared_libs above.
698 "libc",
699 ],
700 },
701 },
702 },
Paul Duffin13f02712020-03-06 12:30:43 +0000703 stl: "none",
704 }
705 `)
706
707 result.CheckSnapshot("mysdk", "",
708 checkAndroidBpContents(`
709// This is auto-generated. DO NOT EDIT.
710
711cc_prebuilt_library_shared {
712 name: "mysdk_mynativelib@current",
713 sdk_member_name: "mynativelib",
714 installable: false,
Paul Duffin0174d8d2020-03-11 18:42:08 +0000715 stl: "none",
Paul Duffin13f02712020-03-06 12:30:43 +0000716 shared_libs: [
717 "mysdk_myothernativelib@current",
718 "libc",
719 ],
720 arch: {
721 arm64: {
722 srcs: ["arm64/lib/mynativelib.so"],
723 },
724 arm: {
725 srcs: ["arm/lib/mynativelib.so"],
726 },
727 },
Paul Duffin13f02712020-03-06 12:30:43 +0000728}
729
730cc_prebuilt_library_shared {
731 name: "mynativelib",
732 prefer: false,
Paul Duffin0174d8d2020-03-11 18:42:08 +0000733 stl: "none",
Paul Duffin13f02712020-03-06 12:30:43 +0000734 shared_libs: [
735 "myothernativelib",
736 "libc",
737 ],
738 arch: {
739 arm64: {
740 srcs: ["arm64/lib/mynativelib.so"],
741 },
742 arm: {
743 srcs: ["arm/lib/mynativelib.so"],
744 },
745 },
Paul Duffin13f02712020-03-06 12:30:43 +0000746}
747
748cc_prebuilt_library_shared {
749 name: "mysdk_myothernativelib@current",
750 sdk_member_name: "myothernativelib",
751 installable: false,
Paul Duffin0174d8d2020-03-11 18:42:08 +0000752 stl: "none",
Paul Duffin13f02712020-03-06 12:30:43 +0000753 system_shared_libs: ["libm"],
754 arch: {
755 arm64: {
756 srcs: ["arm64/lib/myothernativelib.so"],
757 },
758 arm: {
759 srcs: ["arm/lib/myothernativelib.so"],
760 },
761 },
Paul Duffin13f02712020-03-06 12:30:43 +0000762}
763
764cc_prebuilt_library_shared {
765 name: "myothernativelib",
766 prefer: false,
Paul Duffin0174d8d2020-03-11 18:42:08 +0000767 stl: "none",
Paul Duffin13f02712020-03-06 12:30:43 +0000768 system_shared_libs: ["libm"],
769 arch: {
770 arm64: {
771 srcs: ["arm64/lib/myothernativelib.so"],
772 },
773 arm: {
774 srcs: ["arm/lib/myothernativelib.so"],
775 },
776 },
Paul Duffin13f02712020-03-06 12:30:43 +0000777}
778
779cc_prebuilt_library_shared {
780 name: "mysdk_mysystemnativelib@current",
781 sdk_member_name: "mysystemnativelib",
782 installable: false,
Paul Duffin0174d8d2020-03-11 18:42:08 +0000783 stl: "none",
Paul Duffin13f02712020-03-06 12:30:43 +0000784 arch: {
785 arm64: {
786 srcs: ["arm64/lib/mysystemnativelib.so"],
787 },
788 arm: {
789 srcs: ["arm/lib/mysystemnativelib.so"],
790 },
791 },
Paul Duffin13f02712020-03-06 12:30:43 +0000792}
793
794cc_prebuilt_library_shared {
795 name: "mysystemnativelib",
796 prefer: false,
Paul Duffin0174d8d2020-03-11 18:42:08 +0000797 stl: "none",
Paul Duffin13f02712020-03-06 12:30:43 +0000798 arch: {
799 arm64: {
800 srcs: ["arm64/lib/mysystemnativelib.so"],
801 },
802 arm: {
803 srcs: ["arm/lib/mysystemnativelib.so"],
804 },
805 },
Paul Duffin13f02712020-03-06 12:30:43 +0000806}
807
808sdk_snapshot {
809 name: "mysdk@current",
810 native_shared_libs: [
811 "mysdk_mynativelib@current",
812 "mysdk_myothernativelib@current",
813 "mysdk_mysystemnativelib@current",
814 ],
815}
816`),
817 checkAllCopyRules(`
818.intermediates/mynativelib/android_arm64_armv8-a_shared/mynativelib.so -> arm64/lib/mynativelib.so
819.intermediates/mynativelib/android_arm_armv7-a-neon_shared/mynativelib.so -> arm/lib/mynativelib.so
820.intermediates/myothernativelib/android_arm64_armv8-a_shared/myothernativelib.so -> arm64/lib/myothernativelib.so
821.intermediates/myothernativelib/android_arm_armv7-a-neon_shared/myothernativelib.so -> arm/lib/myothernativelib.so
822.intermediates/mysystemnativelib/android_arm64_armv8-a_shared/mysystemnativelib.so -> arm64/lib/mysystemnativelib.so
823.intermediates/mysystemnativelib/android_arm_armv7-a-neon_shared/mysystemnativelib.so -> arm/lib/mysystemnativelib.so
824`),
825 )
826}
827
Paul Duffin9ab556f2019-12-11 18:42:17 +0000828func TestHostSnapshotWithCcSharedLibrary(t *testing.T) {
Paul Duffina80fdec2019-12-03 15:25:00 +0000829 // b/145598135 - Generating host snapshots for anything other than linux is not supported.
830 SkipIfNotLinux(t)
831
Paul Duffind835daa2019-11-30 17:49:09 +0000832 result := testSdkWithCc(t, `
Paul Duffina80fdec2019-12-03 15:25:00 +0000833 sdk {
834 name: "mysdk",
835 device_supported: false,
836 host_supported: true,
837 native_shared_libs: ["mynativelib"],
838 }
839
840 cc_library_shared {
841 name: "mynativelib",
842 device_supported: false,
843 host_supported: true,
844 srcs: [
845 "Test.cpp",
846 "aidl/foo/bar/Test.aidl",
847 ],
848 export_include_dirs: ["include"],
849 aidl: {
850 export_aidl_headers: true,
851 },
Paul Duffina80fdec2019-12-03 15:25:00 +0000852 stl: "none",
Paul Duffin0c394f32020-03-05 14:09:58 +0000853 sdk_version: "minimum",
Paul Duffina80fdec2019-12-03 15:25:00 +0000854 }
855 `)
856
Paul Duffin1356d8c2020-02-25 19:26:33 +0000857 result.CheckSnapshot("mysdk", "",
Paul Duffina80fdec2019-12-03 15:25:00 +0000858 checkAndroidBpContents(`
859// This is auto-generated. DO NOT EDIT.
860
861cc_prebuilt_library_shared {
862 name: "mysdk_mynativelib@current",
863 sdk_member_name: "mynativelib",
864 device_supported: false,
865 host_supported: true,
Paul Duffin0cb37b92020-03-04 14:52:46 +0000866 installable: false,
Paul Duffin0c394f32020-03-05 14:09:58 +0000867 sdk_version: "minimum",
Paul Duffin0174d8d2020-03-11 18:42:08 +0000868 stl: "none",
Paul Duffin57b9e1d2019-12-13 00:03:35 +0000869 export_include_dirs: ["include/include"],
Paul Duffina80fdec2019-12-03 15:25:00 +0000870 arch: {
871 x86_64: {
872 srcs: ["x86_64/lib/mynativelib.so"],
Paul Duffin57b9e1d2019-12-13 00:03:35 +0000873 export_include_dirs: ["x86_64/include_gen/mynativelib"],
Paul Duffina80fdec2019-12-03 15:25:00 +0000874 },
875 x86: {
876 srcs: ["x86/lib/mynativelib.so"],
Paul Duffin57b9e1d2019-12-13 00:03:35 +0000877 export_include_dirs: ["x86/include_gen/mynativelib"],
Paul Duffina80fdec2019-12-03 15:25:00 +0000878 },
879 },
Paul Duffina80fdec2019-12-03 15:25:00 +0000880}
881
882cc_prebuilt_library_shared {
883 name: "mynativelib",
884 prefer: false,
885 device_supported: false,
886 host_supported: true,
Paul Duffin0c394f32020-03-05 14:09:58 +0000887 sdk_version: "minimum",
Paul Duffin0174d8d2020-03-11 18:42:08 +0000888 stl: "none",
Paul Duffin57b9e1d2019-12-13 00:03:35 +0000889 export_include_dirs: ["include/include"],
Paul Duffina80fdec2019-12-03 15:25:00 +0000890 arch: {
891 x86_64: {
892 srcs: ["x86_64/lib/mynativelib.so"],
Paul Duffin57b9e1d2019-12-13 00:03:35 +0000893 export_include_dirs: ["x86_64/include_gen/mynativelib"],
Paul Duffina80fdec2019-12-03 15:25:00 +0000894 },
895 x86: {
896 srcs: ["x86/lib/mynativelib.so"],
Paul Duffin57b9e1d2019-12-13 00:03:35 +0000897 export_include_dirs: ["x86/include_gen/mynativelib"],
Paul Duffina80fdec2019-12-03 15:25:00 +0000898 },
899 },
Paul Duffina80fdec2019-12-03 15:25:00 +0000900}
901
902sdk_snapshot {
903 name: "mysdk@current",
904 device_supported: false,
905 host_supported: true,
906 native_shared_libs: ["mysdk_mynativelib@current"],
907}
908`),
909 checkAllCopyRules(`
Paul Duffin57b9e1d2019-12-13 00:03:35 +0000910include/Test.h -> include/include/Test.h
Paul Duffina80fdec2019-12-03 15:25:00 +0000911.intermediates/mynativelib/linux_glibc_x86_64_shared/mynativelib.so -> x86_64/lib/mynativelib.so
Paul Duffina80fdec2019-12-03 15:25:00 +0000912.intermediates/mynativelib/linux_glibc_x86_64_shared/gen/aidl/aidl/foo/bar/Test.h -> x86_64/include_gen/mynativelib/aidl/foo/bar/Test.h
913.intermediates/mynativelib/linux_glibc_x86_64_shared/gen/aidl/aidl/foo/bar/BnTest.h -> x86_64/include_gen/mynativelib/aidl/foo/bar/BnTest.h
914.intermediates/mynativelib/linux_glibc_x86_64_shared/gen/aidl/aidl/foo/bar/BpTest.h -> x86_64/include_gen/mynativelib/aidl/foo/bar/BpTest.h
915.intermediates/mynativelib/linux_glibc_x86_shared/mynativelib.so -> x86/lib/mynativelib.so
Paul Duffina80fdec2019-12-03 15:25:00 +0000916.intermediates/mynativelib/linux_glibc_x86_shared/gen/aidl/aidl/foo/bar/Test.h -> x86/include_gen/mynativelib/aidl/foo/bar/Test.h
917.intermediates/mynativelib/linux_glibc_x86_shared/gen/aidl/aidl/foo/bar/BnTest.h -> x86/include_gen/mynativelib/aidl/foo/bar/BnTest.h
918.intermediates/mynativelib/linux_glibc_x86_shared/gen/aidl/aidl/foo/bar/BpTest.h -> x86/include_gen/mynativelib/aidl/foo/bar/BpTest.h
919`),
920 )
921}
Paul Duffin9ab556f2019-12-11 18:42:17 +0000922
Paul Duffina04c1072020-03-02 10:16:35 +0000923func TestMultipleHostOsTypesSnapshotWithCcSharedLibrary(t *testing.T) {
924 // b/145598135 - Generating host snapshots for anything other than linux is not supported.
925 SkipIfNotLinux(t)
926
927 result := testSdkWithCc(t, `
928 sdk {
929 name: "mysdk",
930 device_supported: false,
931 host_supported: true,
932 native_shared_libs: ["mynativelib"],
933 target: {
934 windows: {
935 enabled: true,
936 },
937 },
938 }
939
940 cc_library_shared {
941 name: "mynativelib",
942 device_supported: false,
943 host_supported: true,
944 srcs: [
945 "Test.cpp",
946 ],
Paul Duffina04c1072020-03-02 10:16:35 +0000947 stl: "none",
948 target: {
949 windows: {
950 enabled: true,
951 },
952 },
953 }
954 `)
955
956 result.CheckSnapshot("mysdk", "",
957 checkAndroidBpContents(`
958// This is auto-generated. DO NOT EDIT.
959
960cc_prebuilt_library_shared {
961 name: "mysdk_mynativelib@current",
962 sdk_member_name: "mynativelib",
963 device_supported: false,
964 host_supported: true,
Paul Duffin0cb37b92020-03-04 14:52:46 +0000965 installable: false,
Paul Duffin0174d8d2020-03-11 18:42:08 +0000966 stl: "none",
Paul Duffina04c1072020-03-02 10:16:35 +0000967 target: {
968 linux_glibc_x86_64: {
969 srcs: ["linux_glibc/x86_64/lib/mynativelib.so"],
970 },
971 linux_glibc_x86: {
972 srcs: ["linux_glibc/x86/lib/mynativelib.so"],
973 },
974 windows_x86_64: {
975 srcs: ["windows/x86_64/lib/mynativelib.dll"],
976 },
977 },
Paul Duffina04c1072020-03-02 10:16:35 +0000978}
979
980cc_prebuilt_library_shared {
981 name: "mynativelib",
982 prefer: false,
983 device_supported: false,
984 host_supported: true,
Paul Duffin0174d8d2020-03-11 18:42:08 +0000985 stl: "none",
Paul Duffina04c1072020-03-02 10:16:35 +0000986 target: {
987 linux_glibc_x86_64: {
988 srcs: ["linux_glibc/x86_64/lib/mynativelib.so"],
989 },
990 linux_glibc_x86: {
991 srcs: ["linux_glibc/x86/lib/mynativelib.so"],
992 },
993 windows_x86_64: {
994 srcs: ["windows/x86_64/lib/mynativelib.dll"],
995 },
996 },
Paul Duffina04c1072020-03-02 10:16:35 +0000997}
998
999sdk_snapshot {
1000 name: "mysdk@current",
1001 device_supported: false,
1002 host_supported: true,
1003 native_shared_libs: ["mysdk_mynativelib@current"],
Paul Duffin6a7e9532020-03-20 17:50:07 +00001004 target: {
1005 windows: {
1006 compile_multilib: "64",
1007 },
1008 },
Paul Duffina04c1072020-03-02 10:16:35 +00001009}
1010`),
1011 checkAllCopyRules(`
1012.intermediates/mynativelib/linux_glibc_x86_64_shared/mynativelib.so -> linux_glibc/x86_64/lib/mynativelib.so
1013.intermediates/mynativelib/linux_glibc_x86_shared/mynativelib.so -> linux_glibc/x86/lib/mynativelib.so
1014.intermediates/mynativelib/windows_x86_64_shared/mynativelib.dll -> windows/x86_64/lib/mynativelib.dll
1015`),
1016 )
1017}
1018
Paul Duffin9ab556f2019-12-11 18:42:17 +00001019func TestSnapshotWithCcStaticLibrary(t *testing.T) {
1020 result := testSdkWithCc(t, `
Paul Duffine6029182019-12-16 17:43:48 +00001021 module_exports {
1022 name: "myexports",
Paul Duffin9ab556f2019-12-11 18:42:17 +00001023 native_static_libs: ["mynativelib"],
1024 }
1025
1026 cc_library_static {
1027 name: "mynativelib",
1028 srcs: [
1029 "Test.cpp",
1030 "aidl/foo/bar/Test.aidl",
1031 ],
1032 export_include_dirs: ["include"],
1033 aidl: {
1034 export_aidl_headers: true,
1035 },
Paul Duffin9ab556f2019-12-11 18:42:17 +00001036 stl: "none",
1037 }
1038 `)
1039
Paul Duffin1356d8c2020-02-25 19:26:33 +00001040 result.CheckSnapshot("myexports", "",
Paul Duffin9ab556f2019-12-11 18:42:17 +00001041 checkAndroidBpContents(`
1042// This is auto-generated. DO NOT EDIT.
1043
1044cc_prebuilt_library_static {
Paul Duffine6029182019-12-16 17:43:48 +00001045 name: "myexports_mynativelib@current",
Paul Duffin9ab556f2019-12-11 18:42:17 +00001046 sdk_member_name: "mynativelib",
Paul Duffin0cb37b92020-03-04 14:52:46 +00001047 installable: false,
Paul Duffin0174d8d2020-03-11 18:42:08 +00001048 stl: "none",
Paul Duffin57b9e1d2019-12-13 00:03:35 +00001049 export_include_dirs: ["include/include"],
Paul Duffin9ab556f2019-12-11 18:42:17 +00001050 arch: {
1051 arm64: {
1052 srcs: ["arm64/lib/mynativelib.a"],
Paul Duffin57b9e1d2019-12-13 00:03:35 +00001053 export_include_dirs: ["arm64/include_gen/mynativelib"],
Paul Duffin9ab556f2019-12-11 18:42:17 +00001054 },
1055 arm: {
1056 srcs: ["arm/lib/mynativelib.a"],
Paul Duffin57b9e1d2019-12-13 00:03:35 +00001057 export_include_dirs: ["arm/include_gen/mynativelib"],
Paul Duffin9ab556f2019-12-11 18:42:17 +00001058 },
1059 },
Paul Duffin9ab556f2019-12-11 18:42:17 +00001060}
1061
1062cc_prebuilt_library_static {
1063 name: "mynativelib",
1064 prefer: false,
Paul Duffin0174d8d2020-03-11 18:42:08 +00001065 stl: "none",
Paul Duffin57b9e1d2019-12-13 00:03:35 +00001066 export_include_dirs: ["include/include"],
Paul Duffin9ab556f2019-12-11 18:42:17 +00001067 arch: {
1068 arm64: {
1069 srcs: ["arm64/lib/mynativelib.a"],
Paul Duffin57b9e1d2019-12-13 00:03:35 +00001070 export_include_dirs: ["arm64/include_gen/mynativelib"],
Paul Duffin9ab556f2019-12-11 18:42:17 +00001071 },
1072 arm: {
1073 srcs: ["arm/lib/mynativelib.a"],
Paul Duffin57b9e1d2019-12-13 00:03:35 +00001074 export_include_dirs: ["arm/include_gen/mynativelib"],
Paul Duffin9ab556f2019-12-11 18:42:17 +00001075 },
1076 },
Paul Duffin9ab556f2019-12-11 18:42:17 +00001077}
1078
Paul Duffine6029182019-12-16 17:43:48 +00001079module_exports_snapshot {
1080 name: "myexports@current",
1081 native_static_libs: ["myexports_mynativelib@current"],
Paul Duffin9ab556f2019-12-11 18:42:17 +00001082}
1083`),
1084 checkAllCopyRules(`
Paul Duffin57b9e1d2019-12-13 00:03:35 +00001085include/Test.h -> include/include/Test.h
Colin Cross7113d202019-11-20 16:39:12 -08001086.intermediates/mynativelib/android_arm64_armv8-a_static/mynativelib.a -> arm64/lib/mynativelib.a
1087.intermediates/mynativelib/android_arm64_armv8-a_static/gen/aidl/aidl/foo/bar/Test.h -> arm64/include_gen/mynativelib/aidl/foo/bar/Test.h
1088.intermediates/mynativelib/android_arm64_armv8-a_static/gen/aidl/aidl/foo/bar/BnTest.h -> arm64/include_gen/mynativelib/aidl/foo/bar/BnTest.h
1089.intermediates/mynativelib/android_arm64_armv8-a_static/gen/aidl/aidl/foo/bar/BpTest.h -> arm64/include_gen/mynativelib/aidl/foo/bar/BpTest.h
1090.intermediates/mynativelib/android_arm_armv7-a-neon_static/mynativelib.a -> arm/lib/mynativelib.a
1091.intermediates/mynativelib/android_arm_armv7-a-neon_static/gen/aidl/aidl/foo/bar/Test.h -> arm/include_gen/mynativelib/aidl/foo/bar/Test.h
1092.intermediates/mynativelib/android_arm_armv7-a-neon_static/gen/aidl/aidl/foo/bar/BnTest.h -> arm/include_gen/mynativelib/aidl/foo/bar/BnTest.h
1093.intermediates/mynativelib/android_arm_armv7-a-neon_static/gen/aidl/aidl/foo/bar/BpTest.h -> arm/include_gen/mynativelib/aidl/foo/bar/BpTest.h
Paul Duffin9ab556f2019-12-11 18:42:17 +00001094`),
1095 )
1096}
1097
1098func TestHostSnapshotWithCcStaticLibrary(t *testing.T) {
1099 // b/145598135 - Generating host snapshots for anything other than linux is not supported.
1100 SkipIfNotLinux(t)
1101
1102 result := testSdkWithCc(t, `
Paul Duffine6029182019-12-16 17:43:48 +00001103 module_exports {
1104 name: "myexports",
Paul Duffin9ab556f2019-12-11 18:42:17 +00001105 device_supported: false,
1106 host_supported: true,
1107 native_static_libs: ["mynativelib"],
1108 }
1109
1110 cc_library_static {
1111 name: "mynativelib",
1112 device_supported: false,
1113 host_supported: true,
1114 srcs: [
1115 "Test.cpp",
1116 "aidl/foo/bar/Test.aidl",
1117 ],
1118 export_include_dirs: ["include"],
1119 aidl: {
1120 export_aidl_headers: true,
1121 },
Paul Duffin9ab556f2019-12-11 18:42:17 +00001122 stl: "none",
1123 }
1124 `)
1125
Paul Duffin1356d8c2020-02-25 19:26:33 +00001126 result.CheckSnapshot("myexports", "",
Paul Duffin9ab556f2019-12-11 18:42:17 +00001127 checkAndroidBpContents(`
1128// This is auto-generated. DO NOT EDIT.
1129
1130cc_prebuilt_library_static {
Paul Duffine6029182019-12-16 17:43:48 +00001131 name: "myexports_mynativelib@current",
Paul Duffin9ab556f2019-12-11 18:42:17 +00001132 sdk_member_name: "mynativelib",
1133 device_supported: false,
1134 host_supported: true,
Paul Duffin0cb37b92020-03-04 14:52:46 +00001135 installable: false,
Paul Duffin0174d8d2020-03-11 18:42:08 +00001136 stl: "none",
Paul Duffin57b9e1d2019-12-13 00:03:35 +00001137 export_include_dirs: ["include/include"],
Paul Duffin9ab556f2019-12-11 18:42:17 +00001138 arch: {
1139 x86_64: {
1140 srcs: ["x86_64/lib/mynativelib.a"],
Paul Duffin57b9e1d2019-12-13 00:03:35 +00001141 export_include_dirs: ["x86_64/include_gen/mynativelib"],
Paul Duffin9ab556f2019-12-11 18:42:17 +00001142 },
1143 x86: {
1144 srcs: ["x86/lib/mynativelib.a"],
Paul Duffin57b9e1d2019-12-13 00:03:35 +00001145 export_include_dirs: ["x86/include_gen/mynativelib"],
Paul Duffin9ab556f2019-12-11 18:42:17 +00001146 },
1147 },
Paul Duffin9ab556f2019-12-11 18:42:17 +00001148}
1149
1150cc_prebuilt_library_static {
1151 name: "mynativelib",
1152 prefer: false,
1153 device_supported: false,
1154 host_supported: true,
Paul Duffin0174d8d2020-03-11 18:42:08 +00001155 stl: "none",
Paul Duffin57b9e1d2019-12-13 00:03:35 +00001156 export_include_dirs: ["include/include"],
Paul Duffin9ab556f2019-12-11 18:42:17 +00001157 arch: {
1158 x86_64: {
1159 srcs: ["x86_64/lib/mynativelib.a"],
Paul Duffin57b9e1d2019-12-13 00:03:35 +00001160 export_include_dirs: ["x86_64/include_gen/mynativelib"],
Paul Duffin9ab556f2019-12-11 18:42:17 +00001161 },
1162 x86: {
1163 srcs: ["x86/lib/mynativelib.a"],
Paul Duffin57b9e1d2019-12-13 00:03:35 +00001164 export_include_dirs: ["x86/include_gen/mynativelib"],
Paul Duffin9ab556f2019-12-11 18:42:17 +00001165 },
1166 },
Paul Duffin9ab556f2019-12-11 18:42:17 +00001167}
1168
Paul Duffine6029182019-12-16 17:43:48 +00001169module_exports_snapshot {
1170 name: "myexports@current",
Paul Duffin9ab556f2019-12-11 18:42:17 +00001171 device_supported: false,
1172 host_supported: true,
Paul Duffine6029182019-12-16 17:43:48 +00001173 native_static_libs: ["myexports_mynativelib@current"],
Paul Duffin9ab556f2019-12-11 18:42:17 +00001174}
1175`),
1176 checkAllCopyRules(`
Paul Duffin57b9e1d2019-12-13 00:03:35 +00001177include/Test.h -> include/include/Test.h
Paul Duffin9ab556f2019-12-11 18:42:17 +00001178.intermediates/mynativelib/linux_glibc_x86_64_static/mynativelib.a -> x86_64/lib/mynativelib.a
Paul Duffin9ab556f2019-12-11 18:42:17 +00001179.intermediates/mynativelib/linux_glibc_x86_64_static/gen/aidl/aidl/foo/bar/Test.h -> x86_64/include_gen/mynativelib/aidl/foo/bar/Test.h
1180.intermediates/mynativelib/linux_glibc_x86_64_static/gen/aidl/aidl/foo/bar/BnTest.h -> x86_64/include_gen/mynativelib/aidl/foo/bar/BnTest.h
1181.intermediates/mynativelib/linux_glibc_x86_64_static/gen/aidl/aidl/foo/bar/BpTest.h -> x86_64/include_gen/mynativelib/aidl/foo/bar/BpTest.h
1182.intermediates/mynativelib/linux_glibc_x86_static/mynativelib.a -> x86/lib/mynativelib.a
Paul Duffin9ab556f2019-12-11 18:42:17 +00001183.intermediates/mynativelib/linux_glibc_x86_static/gen/aidl/aidl/foo/bar/Test.h -> x86/include_gen/mynativelib/aidl/foo/bar/Test.h
1184.intermediates/mynativelib/linux_glibc_x86_static/gen/aidl/aidl/foo/bar/BnTest.h -> x86/include_gen/mynativelib/aidl/foo/bar/BnTest.h
1185.intermediates/mynativelib/linux_glibc_x86_static/gen/aidl/aidl/foo/bar/BpTest.h -> x86/include_gen/mynativelib/aidl/foo/bar/BpTest.h
1186`),
1187 )
1188}
Paul Duffin13ad94f2020-02-19 16:19:27 +00001189
Paul Duffin9b76c0b2020-03-12 10:24:35 +00001190func TestSnapshotWithCcLibrary(t *testing.T) {
1191 result := testSdkWithCc(t, `
1192 module_exports {
1193 name: "myexports",
1194 native_libs: ["mynativelib"],
1195 }
1196
1197 cc_library {
1198 name: "mynativelib",
1199 srcs: [
1200 "Test.cpp",
1201 ],
1202 export_include_dirs: ["include"],
Paul Duffin9b76c0b2020-03-12 10:24:35 +00001203 stl: "none",
1204 }
1205 `)
1206
1207 result.CheckSnapshot("myexports", "",
1208 checkAndroidBpContents(`
1209// This is auto-generated. DO NOT EDIT.
1210
1211cc_prebuilt_library {
1212 name: "myexports_mynativelib@current",
1213 sdk_member_name: "mynativelib",
1214 installable: false,
1215 stl: "none",
1216 export_include_dirs: ["include/include"],
1217 arch: {
1218 arm64: {
1219 static: {
1220 srcs: ["arm64/lib/mynativelib.a"],
1221 },
1222 shared: {
1223 srcs: ["arm64/lib/mynativelib.so"],
1224 },
1225 },
1226 arm: {
1227 static: {
1228 srcs: ["arm/lib/mynativelib.a"],
1229 },
1230 shared: {
1231 srcs: ["arm/lib/mynativelib.so"],
1232 },
1233 },
1234 },
1235}
1236
1237cc_prebuilt_library {
1238 name: "mynativelib",
1239 prefer: false,
1240 stl: "none",
1241 export_include_dirs: ["include/include"],
1242 arch: {
1243 arm64: {
1244 static: {
1245 srcs: ["arm64/lib/mynativelib.a"],
1246 },
1247 shared: {
1248 srcs: ["arm64/lib/mynativelib.so"],
1249 },
1250 },
1251 arm: {
1252 static: {
1253 srcs: ["arm/lib/mynativelib.a"],
1254 },
1255 shared: {
1256 srcs: ["arm/lib/mynativelib.so"],
1257 },
1258 },
1259 },
1260}
1261
1262module_exports_snapshot {
1263 name: "myexports@current",
1264 native_libs: ["myexports_mynativelib@current"],
1265}
1266`),
1267 checkAllCopyRules(`
1268include/Test.h -> include/include/Test.h
1269.intermediates/mynativelib/android_arm64_armv8-a_static/mynativelib.a -> arm64/lib/mynativelib.a
1270.intermediates/mynativelib/android_arm64_armv8-a_shared/mynativelib.so -> arm64/lib/mynativelib.so
1271.intermediates/mynativelib/android_arm_armv7-a-neon_static/mynativelib.a -> arm/lib/mynativelib.a
1272.intermediates/mynativelib/android_arm_armv7-a-neon_shared/mynativelib.so -> arm/lib/mynativelib.so`),
1273 )
1274}
1275
Paul Duffin13ad94f2020-02-19 16:19:27 +00001276func TestHostSnapshotWithMultiLib64(t *testing.T) {
1277 // b/145598135 - Generating host snapshots for anything other than linux is not supported.
1278 SkipIfNotLinux(t)
1279
1280 result := testSdkWithCc(t, `
1281 module_exports {
1282 name: "myexports",
1283 device_supported: false,
1284 host_supported: true,
1285 target: {
1286 host: {
1287 compile_multilib: "64",
1288 },
1289 },
1290 native_static_libs: ["mynativelib"],
1291 }
1292
1293 cc_library_static {
1294 name: "mynativelib",
1295 device_supported: false,
1296 host_supported: true,
1297 srcs: [
1298 "Test.cpp",
1299 "aidl/foo/bar/Test.aidl",
1300 ],
1301 export_include_dirs: ["include"],
1302 aidl: {
1303 export_aidl_headers: true,
1304 },
Paul Duffin13ad94f2020-02-19 16:19:27 +00001305 stl: "none",
1306 }
1307 `)
1308
Paul Duffin1356d8c2020-02-25 19:26:33 +00001309 result.CheckSnapshot("myexports", "",
Paul Duffin13ad94f2020-02-19 16:19:27 +00001310 checkAndroidBpContents(`
1311// This is auto-generated. DO NOT EDIT.
1312
1313cc_prebuilt_library_static {
1314 name: "myexports_mynativelib@current",
1315 sdk_member_name: "mynativelib",
1316 device_supported: false,
1317 host_supported: true,
Paul Duffin0cb37b92020-03-04 14:52:46 +00001318 installable: false,
Paul Duffin0174d8d2020-03-11 18:42:08 +00001319 stl: "none",
Paul Duffin13ad94f2020-02-19 16:19:27 +00001320 export_include_dirs: ["include/include"],
1321 arch: {
1322 x86_64: {
1323 srcs: ["x86_64/lib/mynativelib.a"],
1324 export_include_dirs: ["x86_64/include_gen/mynativelib"],
1325 },
1326 },
Paul Duffin13ad94f2020-02-19 16:19:27 +00001327}
1328
1329cc_prebuilt_library_static {
1330 name: "mynativelib",
1331 prefer: false,
1332 device_supported: false,
1333 host_supported: true,
Paul Duffin0174d8d2020-03-11 18:42:08 +00001334 stl: "none",
Paul Duffin13ad94f2020-02-19 16:19:27 +00001335 export_include_dirs: ["include/include"],
1336 arch: {
1337 x86_64: {
1338 srcs: ["x86_64/lib/mynativelib.a"],
1339 export_include_dirs: ["x86_64/include_gen/mynativelib"],
1340 },
1341 },
Paul Duffin13ad94f2020-02-19 16:19:27 +00001342}
1343
1344module_exports_snapshot {
1345 name: "myexports@current",
1346 device_supported: false,
1347 host_supported: true,
Paul Duffin07ef3cb2020-03-11 18:17:42 +00001348 native_static_libs: ["myexports_mynativelib@current"],
Paul Duffin13ad94f2020-02-19 16:19:27 +00001349 target: {
Paul Duffin6a7e9532020-03-20 17:50:07 +00001350 linux_glibc: {
Paul Duffin13ad94f2020-02-19 16:19:27 +00001351 compile_multilib: "64",
1352 },
1353 },
Paul Duffin13ad94f2020-02-19 16:19:27 +00001354}`),
1355 checkAllCopyRules(`
1356include/Test.h -> include/include/Test.h
1357.intermediates/mynativelib/linux_glibc_x86_64_static/mynativelib.a -> x86_64/lib/mynativelib.a
1358.intermediates/mynativelib/linux_glibc_x86_64_static/gen/aidl/aidl/foo/bar/Test.h -> x86_64/include_gen/mynativelib/aidl/foo/bar/Test.h
1359.intermediates/mynativelib/linux_glibc_x86_64_static/gen/aidl/aidl/foo/bar/BnTest.h -> x86_64/include_gen/mynativelib/aidl/foo/bar/BnTest.h
1360.intermediates/mynativelib/linux_glibc_x86_64_static/gen/aidl/aidl/foo/bar/BpTest.h -> x86_64/include_gen/mynativelib/aidl/foo/bar/BpTest.h
1361`),
1362 )
1363}
Paul Duffin91756d22020-02-21 16:29:57 +00001364
1365func TestSnapshotWithCcHeadersLibrary(t *testing.T) {
1366 result := testSdkWithCc(t, `
1367 sdk {
1368 name: "mysdk",
1369 native_header_libs: ["mynativeheaders"],
1370 }
1371
1372 cc_library_headers {
1373 name: "mynativeheaders",
1374 export_include_dirs: ["include"],
Paul Duffin91756d22020-02-21 16:29:57 +00001375 stl: "none",
1376 }
1377 `)
1378
Paul Duffin1356d8c2020-02-25 19:26:33 +00001379 result.CheckSnapshot("mysdk", "",
Paul Duffin91756d22020-02-21 16:29:57 +00001380 checkAndroidBpContents(`
1381// This is auto-generated. DO NOT EDIT.
1382
1383cc_prebuilt_library_headers {
1384 name: "mysdk_mynativeheaders@current",
1385 sdk_member_name: "mynativeheaders",
Paul Duffin91756d22020-02-21 16:29:57 +00001386 stl: "none",
Paul Duffin0174d8d2020-03-11 18:42:08 +00001387 export_include_dirs: ["include/include"],
Paul Duffin91756d22020-02-21 16:29:57 +00001388}
1389
1390cc_prebuilt_library_headers {
1391 name: "mynativeheaders",
1392 prefer: false,
Paul Duffin91756d22020-02-21 16:29:57 +00001393 stl: "none",
Paul Duffin0174d8d2020-03-11 18:42:08 +00001394 export_include_dirs: ["include/include"],
Paul Duffin91756d22020-02-21 16:29:57 +00001395}
1396
1397sdk_snapshot {
1398 name: "mysdk@current",
1399 native_header_libs: ["mysdk_mynativeheaders@current"],
1400}
1401`),
1402 checkAllCopyRules(`
1403include/Test.h -> include/include/Test.h
1404`),
1405 )
1406}
1407
1408func TestHostSnapshotWithCcHeadersLibrary(t *testing.T) {
1409 // b/145598135 - Generating host snapshots for anything other than linux is not supported.
1410 SkipIfNotLinux(t)
1411
1412 result := testSdkWithCc(t, `
1413 sdk {
1414 name: "mysdk",
1415 device_supported: false,
1416 host_supported: true,
1417 native_header_libs: ["mynativeheaders"],
1418 }
1419
1420 cc_library_headers {
1421 name: "mynativeheaders",
1422 device_supported: false,
1423 host_supported: true,
1424 export_include_dirs: ["include"],
Paul Duffin91756d22020-02-21 16:29:57 +00001425 stl: "none",
1426 }
1427 `)
1428
Paul Duffin1356d8c2020-02-25 19:26:33 +00001429 result.CheckSnapshot("mysdk", "",
Paul Duffin91756d22020-02-21 16:29:57 +00001430 checkAndroidBpContents(`
1431// This is auto-generated. DO NOT EDIT.
1432
1433cc_prebuilt_library_headers {
1434 name: "mysdk_mynativeheaders@current",
1435 sdk_member_name: "mynativeheaders",
1436 device_supported: false,
1437 host_supported: true,
Paul Duffin91756d22020-02-21 16:29:57 +00001438 stl: "none",
Paul Duffin0174d8d2020-03-11 18:42:08 +00001439 export_include_dirs: ["include/include"],
Paul Duffin91756d22020-02-21 16:29:57 +00001440}
1441
1442cc_prebuilt_library_headers {
1443 name: "mynativeheaders",
1444 prefer: false,
1445 device_supported: false,
1446 host_supported: true,
Paul Duffin91756d22020-02-21 16:29:57 +00001447 stl: "none",
Paul Duffin0174d8d2020-03-11 18:42:08 +00001448 export_include_dirs: ["include/include"],
Paul Duffin91756d22020-02-21 16:29:57 +00001449}
1450
1451sdk_snapshot {
1452 name: "mysdk@current",
1453 device_supported: false,
1454 host_supported: true,
1455 native_header_libs: ["mysdk_mynativeheaders@current"],
1456}
1457`),
1458 checkAllCopyRules(`
1459include/Test.h -> include/include/Test.h
1460`),
1461 )
1462}
Paul Duffina04c1072020-03-02 10:16:35 +00001463
1464func TestDeviceAndHostSnapshotWithCcHeadersLibrary(t *testing.T) {
1465 // b/145598135 - Generating host snapshots for anything other than linux is not supported.
1466 SkipIfNotLinux(t)
1467
1468 result := testSdkWithCc(t, `
1469 sdk {
1470 name: "mysdk",
1471 host_supported: true,
1472 native_header_libs: ["mynativeheaders"],
1473 }
1474
1475 cc_library_headers {
1476 name: "mynativeheaders",
1477 host_supported: true,
Paul Duffina04c1072020-03-02 10:16:35 +00001478 stl: "none",
1479 export_system_include_dirs: ["include"],
1480 target: {
1481 android: {
1482 export_include_dirs: ["include-android"],
1483 },
1484 host: {
1485 export_include_dirs: ["include-host"],
1486 },
1487 },
1488 }
1489 `)
1490
1491 result.CheckSnapshot("mysdk", "",
1492 checkAndroidBpContents(`
1493// This is auto-generated. DO NOT EDIT.
1494
1495cc_prebuilt_library_headers {
1496 name: "mysdk_mynativeheaders@current",
1497 sdk_member_name: "mynativeheaders",
1498 host_supported: true,
Paul Duffin0174d8d2020-03-11 18:42:08 +00001499 stl: "none",
Paul Duffina04c1072020-03-02 10:16:35 +00001500 export_system_include_dirs: ["include/include"],
1501 target: {
1502 android: {
1503 export_include_dirs: ["include/include-android"],
1504 },
1505 linux_glibc: {
1506 export_include_dirs: ["include/include-host"],
1507 },
1508 },
Paul Duffina04c1072020-03-02 10:16:35 +00001509}
1510
1511cc_prebuilt_library_headers {
1512 name: "mynativeheaders",
1513 prefer: false,
1514 host_supported: true,
Paul Duffin0174d8d2020-03-11 18:42:08 +00001515 stl: "none",
Paul Duffina04c1072020-03-02 10:16:35 +00001516 export_system_include_dirs: ["include/include"],
1517 target: {
1518 android: {
1519 export_include_dirs: ["include/include-android"],
1520 },
1521 linux_glibc: {
1522 export_include_dirs: ["include/include-host"],
1523 },
1524 },
Paul Duffina04c1072020-03-02 10:16:35 +00001525}
1526
1527sdk_snapshot {
1528 name: "mysdk@current",
1529 host_supported: true,
1530 native_header_libs: ["mysdk_mynativeheaders@current"],
1531}
1532`),
1533 checkAllCopyRules(`
1534include/Test.h -> include/include/Test.h
1535include-android/AndroidTest.h -> include/include-android/AndroidTest.h
1536include-host/HostTest.h -> include/include-host/HostTest.h
1537`),
1538 )
1539}
Martin Stjernholm10566a02020-03-24 01:19:52 +00001540
1541func TestSystemSharedLibPropagation(t *testing.T) {
Martin Stjernholm66a06942020-03-26 17:39:30 +00001542 // b/145598135 - Generating host snapshots for anything other than linux is not supported.
1543 SkipIfNotLinux(t)
1544
Martin Stjernholm10566a02020-03-24 01:19:52 +00001545 result := testSdkWithCc(t, `
1546 sdk {
1547 name: "mysdk",
1548 native_shared_libs: ["sslnil", "sslempty", "sslnonempty"],
1549 }
1550
1551 cc_library {
1552 name: "sslnil",
1553 host_supported: true,
1554 }
1555
1556 cc_library {
1557 name: "sslempty",
1558 system_shared_libs: [],
1559 }
1560
1561 cc_library {
1562 name: "sslnonempty",
1563 system_shared_libs: ["sslnil"],
1564 }
1565 `)
1566
1567 result.CheckSnapshot("mysdk", "",
1568 checkAndroidBpContents(`
1569// This is auto-generated. DO NOT EDIT.
1570
1571cc_prebuilt_library_shared {
1572 name: "mysdk_sslnil@current",
1573 sdk_member_name: "sslnil",
1574 installable: false,
1575 arch: {
1576 arm64: {
1577 srcs: ["arm64/lib/sslnil.so"],
1578 },
1579 arm: {
1580 srcs: ["arm/lib/sslnil.so"],
1581 },
1582 },
1583}
1584
1585cc_prebuilt_library_shared {
1586 name: "sslnil",
1587 prefer: false,
1588 arch: {
1589 arm64: {
1590 srcs: ["arm64/lib/sslnil.so"],
1591 },
1592 arm: {
1593 srcs: ["arm/lib/sslnil.so"],
1594 },
1595 },
1596}
1597
1598cc_prebuilt_library_shared {
1599 name: "mysdk_sslempty@current",
1600 sdk_member_name: "sslempty",
1601 installable: false,
1602 system_shared_libs: [],
1603 arch: {
1604 arm64: {
1605 srcs: ["arm64/lib/sslempty.so"],
1606 },
1607 arm: {
1608 srcs: ["arm/lib/sslempty.so"],
1609 },
1610 },
1611}
1612
1613cc_prebuilt_library_shared {
1614 name: "sslempty",
1615 prefer: false,
1616 system_shared_libs: [],
1617 arch: {
1618 arm64: {
1619 srcs: ["arm64/lib/sslempty.so"],
1620 },
1621 arm: {
1622 srcs: ["arm/lib/sslempty.so"],
1623 },
1624 },
1625}
1626
1627cc_prebuilt_library_shared {
1628 name: "mysdk_sslnonempty@current",
1629 sdk_member_name: "sslnonempty",
1630 installable: false,
1631 system_shared_libs: ["mysdk_sslnil@current"],
1632 arch: {
1633 arm64: {
1634 srcs: ["arm64/lib/sslnonempty.so"],
1635 },
1636 arm: {
1637 srcs: ["arm/lib/sslnonempty.so"],
1638 },
1639 },
1640}
1641
1642cc_prebuilt_library_shared {
1643 name: "sslnonempty",
1644 prefer: false,
1645 system_shared_libs: ["sslnil"],
1646 arch: {
1647 arm64: {
1648 srcs: ["arm64/lib/sslnonempty.so"],
1649 },
1650 arm: {
1651 srcs: ["arm/lib/sslnonempty.so"],
1652 },
1653 },
1654}
1655
1656sdk_snapshot {
1657 name: "mysdk@current",
1658 native_shared_libs: [
1659 "mysdk_sslnil@current",
1660 "mysdk_sslempty@current",
1661 "mysdk_sslnonempty@current",
1662 ],
1663}
1664`))
1665
1666 result = testSdkWithCc(t, `
1667 sdk {
1668 name: "mysdk",
1669 host_supported: true,
1670 native_shared_libs: ["sslvariants"],
1671 }
1672
1673 cc_library {
1674 name: "sslvariants",
1675 host_supported: true,
1676 target: {
1677 android: {
1678 system_shared_libs: [],
1679 },
1680 },
1681 }
1682 `)
1683
1684 result.CheckSnapshot("mysdk", "",
1685 checkAndroidBpContents(`
1686// This is auto-generated. DO NOT EDIT.
1687
1688cc_prebuilt_library_shared {
1689 name: "mysdk_sslvariants@current",
1690 sdk_member_name: "sslvariants",
1691 host_supported: true,
1692 installable: false,
1693 target: {
1694 android: {
1695 system_shared_libs: [],
1696 },
1697 android_arm64: {
1698 srcs: ["android/arm64/lib/sslvariants.so"],
1699 },
1700 android_arm: {
1701 srcs: ["android/arm/lib/sslvariants.so"],
1702 },
1703 linux_glibc_x86_64: {
1704 srcs: ["linux_glibc/x86_64/lib/sslvariants.so"],
1705 },
1706 linux_glibc_x86: {
1707 srcs: ["linux_glibc/x86/lib/sslvariants.so"],
1708 },
1709 },
1710}
1711
1712cc_prebuilt_library_shared {
1713 name: "sslvariants",
1714 prefer: false,
1715 host_supported: true,
1716 target: {
1717 android: {
1718 system_shared_libs: [],
1719 },
1720 android_arm64: {
1721 srcs: ["android/arm64/lib/sslvariants.so"],
1722 },
1723 android_arm: {
1724 srcs: ["android/arm/lib/sslvariants.so"],
1725 },
1726 linux_glibc_x86_64: {
1727 srcs: ["linux_glibc/x86_64/lib/sslvariants.so"],
1728 },
1729 linux_glibc_x86: {
1730 srcs: ["linux_glibc/x86/lib/sslvariants.so"],
1731 },
1732 },
1733}
1734
1735sdk_snapshot {
1736 name: "mysdk@current",
1737 host_supported: true,
1738 native_shared_libs: ["mysdk_sslvariants@current"],
1739}
1740`))
1741}