1cc_defaults {
2    name: "gd_defaults",
3    target: {
4        android: {
5            test_config_template: "AndroidTestTemplate.xml",
6            cflags: [
7                "-DOS_ANDROID",
8                "-DOS_LINUX_GENERIC",
9            ],
10            shared_libs: [
11                "liblog",
12            ],
13        },
14        host: {
15            cflags: [
16                "-DOS_LINUX",
17                "-DOS_LINUX_GENERIC",
18            ],
19        },
20        darwin: {
21            enabled: false,
22        },
23    },
24    cpp_std: "c++17",
25    cflags: [
26        "-DEXPORT_SYMBOL=__attribute__((visibility(\"default\")))",
27        "-fvisibility=hidden",
28        "-DLOG_NDEBUG=1",
29        "-DGOOGLE_PROTOBUF_NO_RTTI",
30        "-Wno-unused-parameter",
31        "-Wno-unused-result",
32    ],
33    conlyflags: [
34        "-std=c99",
35    ],
36    header_libs: ["jni_headers"],
37    sanitize: {
38        misc_undefined: ["bounds"],
39    },
40}
41
42// Enables code coverage for a set of source files. Must be combined with
43// "clang_coverage_bin" in order to work. See //test/gen_coverage.py for more information
44// on generating code coverage.
45cc_defaults {
46    name: "gd_clang_file_coverage",
47    target: {
48        host: {
49            clang_cflags: [
50                "-fprofile-instr-generate",
51                "-fcoverage-mapping",
52            ],
53        },
54    },
55}
56
57// Enabled code coverage on a binary. These flags allow libraries that were
58// compiled with "clang_file_coverage" to be properly linked together in
59// order to create a binary that will create a profraw file when ran. Note
60// these flags themselves don't enable code coverage for the source files
61// compiled in the binary. See //test/gen_coverage.py for more information
62// on generating code coverage.
63cc_defaults {
64    name: "gd_clang_coverage_bin",
65    target: {
66        host: {
67            ldflags: [
68                "-fprofile-instr-generate",
69                "-fcoverage-mapping",
70            ],
71        },
72    },
73}
74
75cc_defaults {
76    name: "gd_clang_tidy",
77    tidy: true,
78    tidy_checks: [
79        "cppcoreguidelines-pro-type-member-init",
80        "clang-analyzer-core.CallAndMessage",
81        "clang-analyzer-optin.cplusplus.UninitializedObject",
82        "-google*",
83        "-performance*",
84        "-bugprone*",
85    ],
86    tidy_checks_as_errors: [
87        "cppcoreguidelines-pro-type-member-init",
88        "clang-analyzer-core.CallAndMessage",
89        "clang-analyzer-optin.cplusplus.UninitializedObject",
90    ],
91    tidy_flags: [
92        "--header-filter=^.*system/bt/.*.h$",
93        "--extra-arg-before=-Xclang",
94        "--extra-arg-before=-analyzer-config",
95        "--extra-arg-before=-Xclang",
96        "--extra-arg-before=optin.cplusplus.UninitializedObject:Pedantic=true",
97        "--extra-arg-before=-Xclang",
98        "--extra-arg-before=-analyzer-config",
99        "--extra-arg-before=-Xclang",
100        "--extra-arg-before=optin.cplusplus.UninitializedObject:CheckPointeeInitialization=true",
101    ],
102}
103
104cc_defaults {
105    name: "libbluetooth_gd_defaults",
106    defaults: [
107        "gd_defaults",
108        "gd_clang_file_coverage",
109    ],
110    host_supported: true,
111    target: {
112        linux: {
113            srcs: [
114                ":BluetoothOsSources_linux_generic",
115            ],
116        },
117        host: {
118            srcs: [
119                ":BluetoothHalSources_hci_rootcanal",
120                ":BluetoothOsSources_host",
121            ],
122        },
123        android: {
124            srcs: [
125                ":BluetoothHalSources_hci_android_hidl",
126                ":BluetoothOsSources_android",
127            ],
128            shared_libs: [
129                "android.hardware.bluetooth@1.0",
130                "libhidlbase",
131                "libutils",
132                "libcutils",
133            ],
134        },
135    },
136    srcs: [
137        "stack_manager.cc",
138        "module.cc",
139        ":BluetoothAttSources",
140        ":BluetoothCommonSources",
141        ":BluetoothCryptoToolboxSources",
142        ":BluetoothDumpsysSources",
143        ":BluetoothHalSources",
144        ":BluetoothHciSources",
145        ":BluetoothL2capSources",
146        ":BluetoothNeighborSources",
147        ":BluetoothPacketSources",
148        ":BluetoothShimSources",
149        ":BluetoothSecuritySources",
150        ":BluetoothStorageSources",
151    ],
152    generated_headers: [
153        "BluetoothGeneratedBundlerSchema_h_bfbs",
154        "BluetoothGeneratedDumpsysDataSchema_h",
155        "BluetoothGeneratedDumpsysBundledSchema_h",
156        "BluetoothGeneratedPackets_h",
157    ],
158    shared_libs: [
159        "libchrome",
160        "libcrypto",
161        "libflatbuffers-cpp",
162    ],
163    static_libs: [
164        "libbluetooth-protos",
165    ]
166}
167
168cc_library {
169    name: "libbluetooth_gd",
170    defaults: [
171        "libbluetooth_gd_defaults",
172    ],
173}
174
175cc_library {
176    name: "libbluetooth_gd_fuzzing",
177    defaults: [
178        "libbluetooth_gd_defaults",
179    ],
180    srcs: [
181        ":BluetoothOsSources_fuzz",
182    ],
183    cflags: [
184        "-DFUZZ_TARGET",
185    ],
186}
187
188cc_binary {
189    name: "bluetooth_stack_with_facade",
190    defaults: [
191        "gd_defaults",
192        "gd_clang_coverage_bin",
193    ],
194    host_supported: true,
195    srcs: [
196        "facade/facade_main.cc",
197        "facade/grpc_root_server.cc",
198        "facade/read_only_property_server.cc",
199        "grpc/grpc_module.cc",
200        ":BluetoothFacade_hci_hal",
201        ":BluetoothFacade_hci_layer",
202        ":BluetoothFacade_l2cap_layer",
203        ":BluetoothFacade_neighbor",
204        ":BluetoothFacade_security_layer",
205        ":BluetoothFacade_shim_layer",
206    ],
207    generated_headers: [
208        "BluetoothFacadeGeneratedStub_h",
209        "BluetoothGeneratedBundlerSchema_h_bfbs",
210        "BluetoothGeneratedDumpsysDataSchema_h",
211        "BluetoothGeneratedPackets_h",
212        // Needed here to guarantee that generated zip file is created before
213        // bluetooth_cert_tests.zip is packaged
214        "BluetoothFacadeAndCertGeneratedStub_py",
215    ],
216    generated_sources: [
217        "BluetoothFacadeGeneratedStub_cc",
218    ],
219    static_libs: [
220        "breakpad_client",
221        "libbluetooth-protos",
222        "libbluetooth_gd",
223        "libflatbuffers-cpp",
224    ],
225    shared_libs: [
226        "libbacktrace",
227        "libchrome",
228        "libcrypto",
229        "libgrpc++_unsecure",
230        "libprotobuf-cpp-full",
231    ],
232    target: {
233        android: {
234            shared_libs: [
235                "android.hardware.bluetooth@1.0",
236                "libhidlbase",
237                "libutils",
238                "libcutils",
239            ],
240        },
241        host: {
242            required: [
243                "root-canal",
244            ],
245        },
246    },
247}
248
249cc_test {
250    name: "bluetooth_test_gd",
251    test_suites: ["device-tests"],
252    defaults: [
253        "gd_defaults",
254        "gd_clang_coverage_bin",
255    ],
256    host_supported: true,
257    target: {
258        linux: {
259            srcs: [
260                ":BluetoothOsTestSources_linux_generic",
261            ],
262        },
263        host: {
264            srcs: [
265                ":BluetoothHalTestSources_hci_rootcanal",
266            ],
267        },
268        android: {
269            srcs: [
270                ":BluetoothHalTestSources_hci_android_hidl",
271                ":BluetoothOsTestSources_android",
272            ],
273            shared_libs: [
274                "android.hardware.bluetooth@1.0",
275                "libhidlbase",
276                "libutils",
277                "libcutils",
278            ],
279        },
280    },
281    srcs: [
282        "module_unittest.cc",
283        "stack_manager_unittest.cc",
284        ":BluetoothAttTestSources",
285        ":BluetoothCommonTestSources",
286        ":BluetoothCryptoToolboxTestSources",
287        ":BluetoothDumpsysTestSources",
288        ":BluetoothHciTestSources",
289        ":BluetoothL2capTestSources",
290        ":BluetoothNeighborTestSources",
291        ":BluetoothPacketTestSources",
292        ":BluetoothSecurityTestSources",
293        ":BluetoothShimTestSources",
294        ":BluetoothStorageTestSources",
295    ],
296    generated_headers: [
297        "BluetoothGeneratedBundlerSchema_h_bfbs",
298        "BluetoothGeneratedDumpsysBundledSchema_h",
299        "BluetoothGeneratedDumpsysBundledTestSchema_h",
300        "BluetoothGeneratedDumpsysDataSchema_h",
301        "BluetoothGeneratedDumpsysTestData_h",
302        "BluetoothGeneratedPackets_h",
303    ],
304    static_libs: [
305        "libbluetooth-protos",
306        "libbluetooth_gd",
307        "libc++fs",
308        "libflatbuffers-cpp",
309        "libgmock",
310    ],
311    shared_libs: [
312        "libchrome",
313        "libcrypto",
314    ],
315    sanitize: {
316        address: true,
317    },
318}
319
320cc_test {
321    name: "bluetooth_packet_parser_test",
322    test_suites: ["device-tests"],
323    defaults: [
324        "gd_defaults",
325        "gd_clang_coverage_bin",
326    ],
327    host_supported: true,
328    srcs: [
329        ":BluetoothPacketSources",
330        ":BluetoothPacketParserTestPacketTestSources",
331    ],
332    generated_headers: [
333        "BluetoothPacketParserTestPacketPdlGen_h",
334    ],
335    sanitize: {
336        address: true,
337        cfi: true,
338    },
339}
340
341cc_defaults {
342    name: "gd_fuzz_defaults",
343    defaults: ["gd_defaults"],
344    srcs: [
345        ":BluetoothFuzzHelperSources",
346        ":BluetoothHciFuzzHelperSources",
347    ],
348    static_libs: [
349        "libbluetooth-protos",
350        "libbluetooth_gd_fuzzing",
351        "libchrome",
352        "libgmock",
353        "libgtest",
354    ],
355    host_supported: true,
356    generated_headers: [
357        "BluetoothGeneratedDumpsysDataSchema_h",
358        "BluetoothGeneratedPackets_h",
359    ],
360    shared_libs: [
361        "libcrypto",
362        "libflatbuffers-cpp",
363    ],
364    cflags: [
365        "-DFUZZ_TARGET",
366    ],
367    target: {
368        android: {
369            shared_libs: [
370                "android.hardware.bluetooth@1.0",
371                "libcutils",
372                "libhidlbase",
373                "libutils",
374            ],
375        },
376    },
377}
378
379cc_fuzz {
380    name: "bluetooth_gd_fuzz_test",
381    defaults: ["gd_fuzz_defaults"],
382    srcs: [
383        "fuzz_test.cc",
384        ":BluetoothHciFuzzTestSources",
385        ":BluetoothL2capFuzzTestSources",
386    ],
387}
388
389cc_fuzz {
390    name: "bluetooth_gd_hci_layer_fuzz_test",
391    defaults: ["gd_fuzz_defaults"],
392    srcs: [
393        "hci/fuzz/hci_layer_fuzz_test.cc",
394        ":BluetoothHalFuzzSources",
395    ],
396}
397
398cc_fuzz {
399    name: "bluetooth_gd_acl_manager_fuzz_test",
400    defaults: ["gd_fuzz_defaults"],
401    srcs: [
402        "hci/fuzz/acl_manager_fuzz_test.cc",
403    ],
404}
405
406cc_benchmark {
407    name: "bluetooth_benchmark_gd",
408    defaults: ["gd_defaults"],
409    host_supported: true,
410    srcs: [
411        "benchmark.cc",
412        ":BluetoothOsBenchmarkSources",
413    ],
414    static_libs: [
415        "libbluetooth_gd",
416    ],
417    shared_libs: [
418        "libchrome",
419    ],
420}
421
422filegroup {
423    name: "BluetoothHciClassSources",
424    srcs: [
425        "hci/address.cc",
426        "hci/class_of_device.cc",
427    ],
428}
429
430genrule {
431    name: "BluetoothGeneratedPackets_h",
432    tools: [
433        "bluetooth_packetgen",
434    ],
435    cmd: "$(location bluetooth_packetgen) --include=system/bt/gd --out=$(genDir) $(in)",
436    srcs: [
437        "hci/hci_packets.pdl",
438        "l2cap/l2cap_packets.pdl",
439        "security/smp_packets.pdl",
440    ],
441    out: [
442        "hci/hci_packets.h",
443        "l2cap/l2cap_packets.h",
444        "security/smp_packets.h",
445    ],
446}
447
448// Generates binary schema data to be bundled and source file generated
449genrule {
450    name: "BluetoothGeneratedDumpsysBinarySchema_bfbs",
451    tools: [
452        "flatc",
453    ],
454    cmd: "$(location flatc) -I system/bt/gd -b --schema -o $(genDir) $(in) ",
455    srcs: [
456        "dumpsys_data.fbs",
457        "shim/dumpsys.fbs",
458    ],
459    out: [
460        "dumpsys_data.bfbs",
461        "dumpsys.bfbs",
462    ],
463}
464
465genrule {
466    name: "BluetoothGeneratedDumpsysDataSchema_h",
467    tools: [
468        "flatc",
469    ],
470    cmd: "$(location flatc) -I system/bt/gd -o $(genDir) --cpp $(in) ",
471    srcs: [
472        "dumpsys_data.fbs",
473        "shim/dumpsys.fbs",
474    ],
475    out: [
476        "dumpsys_data_generated.h",
477        "dumpsys_generated.h",
478    ],
479}
480
481genrule {
482    name: "BluetoothGeneratedPackets_python3_cc",
483    tools: [
484        "bluetooth_packetgen",
485    ],
486    cmd: "$(location bluetooth_packetgen) --include=system/bt/gd --out=$(genDir) --num_shards=10 $(in)",
487    srcs: [
488        "hci/hci_packets.pdl",
489        "l2cap/l2cap_packets.pdl",
490        "security/smp_packets.pdl",
491    ],
492    out: [
493        "hci/hci_packets_python3.cc",
494        "hci/hci_packets_python3_shard_0.cc",
495        "hci/hci_packets_python3_shard_1.cc",
496        "hci/hci_packets_python3_shard_2.cc",
497        "hci/hci_packets_python3_shard_3.cc",
498        "hci/hci_packets_python3_shard_4.cc",
499        "hci/hci_packets_python3_shard_5.cc",
500        "hci/hci_packets_python3_shard_6.cc",
501        "hci/hci_packets_python3_shard_7.cc",
502        "hci/hci_packets_python3_shard_8.cc",
503        "hci/hci_packets_python3_shard_9.cc",
504        "l2cap/l2cap_packets_python3.cc",
505        "l2cap/l2cap_packets_python3_shard_0.cc",
506        "l2cap/l2cap_packets_python3_shard_1.cc",
507        "l2cap/l2cap_packets_python3_shard_2.cc",
508        "l2cap/l2cap_packets_python3_shard_3.cc",
509        "l2cap/l2cap_packets_python3_shard_4.cc",
510        "l2cap/l2cap_packets_python3_shard_5.cc",
511        "l2cap/l2cap_packets_python3_shard_6.cc",
512        "l2cap/l2cap_packets_python3_shard_7.cc",
513        "l2cap/l2cap_packets_python3_shard_8.cc",
514        "l2cap/l2cap_packets_python3_shard_9.cc",
515        "security/smp_packets_python3.cc",
516        "security/smp_packets_python3_shard_0.cc",
517        "security/smp_packets_python3_shard_1.cc",
518        "security/smp_packets_python3_shard_2.cc",
519        "security/smp_packets_python3_shard_3.cc",
520        "security/smp_packets_python3_shard_4.cc",
521        "security/smp_packets_python3_shard_5.cc",
522        "security/smp_packets_python3_shard_6.cc",
523        "security/smp_packets_python3_shard_7.cc",
524        "security/smp_packets_python3_shard_8.cc",
525        "security/smp_packets_python3_shard_9.cc",
526    ],
527}
528
529filegroup {
530    name: "BluetoothFacadeProto",
531    srcs: [
532        "facade/common.proto",
533        "facade/rootservice.proto",
534        "hal/facade.proto",
535        "hci/facade/facade.proto",
536        "hci/facade/acl_manager_facade.proto",
537        "hci/facade/controller_facade.proto",
538        "hci/facade/le_acl_manager_facade.proto",
539        "hci/facade/le_advertising_manager_facade.proto",
540        "hci/facade/le_initiator_address_facade.proto",
541        "hci/facade/le_scanning_manager_facade.proto",
542        "neighbor/facade/facade.proto",
543        "l2cap/classic/facade.proto",
544        "l2cap/le/facade.proto",
545        "security/facade.proto",
546        "shim/facade/facade.proto",
547    ],
548}
549
550genrule {
551    name: "BluetoothFacadeGeneratedStub_h",
552    tools: [
553        "aprotoc",
554        "protoc-gen-grpc-cpp-plugin",
555    ],
556    cmd: "$(location aprotoc) -Isystem/bt/gd -Iexternal/protobuf/src --plugin=protoc-gen-grpc=$(location protoc-gen-grpc-cpp-plugin) $(in) --grpc_out=$(genDir) --cpp_out=$(genDir)",
557    srcs: [
558        ":BluetoothFacadeProto",
559    ],
560    out: [
561        "facade/common.grpc.pb.h",
562        "facade/common.pb.h",
563        "facade/rootservice.grpc.pb.h",
564        "facade/rootservice.pb.h",
565        "hal/facade.grpc.pb.h",
566        "hal/facade.pb.h",
567        "hci/facade/facade.grpc.pb.h",
568        "hci/facade/facade.pb.h",
569        "hci/facade/acl_manager_facade.grpc.pb.h",
570        "hci/facade/acl_manager_facade.pb.h",
571        "hci/facade/controller_facade.grpc.pb.h",
572        "hci/facade/controller_facade.pb.h",
573        "hci/facade/le_acl_manager_facade.grpc.pb.h",
574        "hci/facade/le_acl_manager_facade.pb.h",
575        "hci/facade/le_advertising_manager_facade.grpc.pb.h",
576        "hci/facade/le_advertising_manager_facade.pb.h",
577        "hci/facade/le_initiator_address_facade.grpc.pb.h",
578        "hci/facade/le_initiator_address_facade.pb.h",
579        "hci/facade/le_scanning_manager_facade.grpc.pb.h",
580        "hci/facade/le_scanning_manager_facade.pb.h",
581        "l2cap/classic/facade.grpc.pb.h",
582        "l2cap/classic/facade.pb.h",
583        "l2cap/le/facade.grpc.pb.h",
584        "l2cap/le/facade.pb.h",
585        "neighbor/facade/facade.grpc.pb.h",
586        "neighbor/facade/facade.pb.h",
587        "security/facade.grpc.pb.h",
588        "security/facade.pb.h",
589        "shim/facade/facade.grpc.pb.h",
590        "shim/facade/facade.pb.h",
591    ],
592}
593
594genrule {
595    name: "BluetoothFacadeGeneratedStub_cc",
596    tools: [
597        "aprotoc",
598        "protoc-gen-grpc-cpp-plugin",
599    ],
600    cmd: "$(location aprotoc) -Isystem/bt/gd -Iexternal/protobuf/src --plugin=protoc-gen-grpc=$(location protoc-gen-grpc-cpp-plugin) $(in) --grpc_out=$(genDir) --cpp_out=$(genDir)",
601    srcs: [
602        ":BluetoothFacadeProto",
603    ],
604    out: [
605        "facade/common.grpc.pb.cc",
606        "facade/common.pb.cc",
607        "facade/rootservice.grpc.pb.cc",
608        "facade/rootservice.pb.cc",
609        "hal/facade.grpc.pb.cc",
610        "hal/facade.pb.cc",
611        "hci/facade/facade.grpc.pb.cc",
612        "hci/facade/facade.pb.cc",
613        "hci/facade/acl_manager_facade.grpc.pb.cc",
614        "hci/facade/acl_manager_facade.pb.cc",
615        "hci/facade/controller_facade.grpc.pb.cc",
616        "hci/facade/controller_facade.pb.cc",
617        "hci/facade/le_acl_manager_facade.grpc.pb.cc",
618        "hci/facade/le_acl_manager_facade.pb.cc",
619        "hci/facade/le_advertising_manager_facade.grpc.pb.cc",
620        "hci/facade/le_advertising_manager_facade.pb.cc",
621        "hci/facade/le_initiator_address_facade.grpc.pb.cc",
622        "hci/facade/le_initiator_address_facade.pb.cc",
623        "hci/facade/le_scanning_manager_facade.grpc.pb.cc",
624        "hci/facade/le_scanning_manager_facade.pb.cc",
625        "l2cap/classic/facade.grpc.pb.cc",
626        "l2cap/classic/facade.pb.cc",
627        "l2cap/le/facade.grpc.pb.cc",
628        "l2cap/le/facade.pb.cc",
629        "neighbor/facade/facade.grpc.pb.cc",
630        "neighbor/facade/facade.pb.cc",
631        "security/facade.grpc.pb.cc",
632        "security/facade.pb.cc",
633        "shim/facade/facade.grpc.pb.cc",
634        "shim/facade/facade.pb.cc",
635    ],
636}
637
638genrule {
639    name: "BluetoothFacadeAndCertGeneratedStub_py",
640    tools: [
641        "aprotoc",
642        "protoc-gen-grpc-python-plugin",
643        "soong_zip",
644    ],
645    cmd: "mkdir -p $(genDir)/files && " +
646        "$(location aprotoc) -Isystem/bt/gd -Iexternal/protobuf/src --plugin=protoc-gen-grpc=$(location protoc-gen-grpc-python-plugin) $(in) --grpc_out=$(genDir)/files --python_out=$(genDir)/files && " +
647        "mkdir -p $(genDir)/files/cert && " +
648        "touch $(genDir)/files/cert/__init__.py && " +
649        "touch $(genDir)/files/facade/__init__.py && " +
650        "touch $(genDir)/files/hal/__init__.py && " +
651        "touch $(genDir)/files/hci/__init__.py && " +
652        "touch $(genDir)/files/hci/facade/__init__.py && " +
653        "touch $(genDir)/files/l2cap/classic/__init__.py && " +
654        "touch $(genDir)/files/l2cap/le/__init__.py && " +
655        "touch $(genDir)/files/neighbor/facade/__init__.py && " +
656        "touch $(genDir)/files/security/__init__.py && " +
657        "$(location soong_zip) -C $(genDir)/files -D $(genDir)/files -o $(out)",
658    srcs: [
659        ":BluetoothFacadeProto",
660    ],
661    out: ["bluetooth_cert_generated_py.zip"],
662}
663
664cc_defaults {
665    name: "bluetooth_py3_native_extension_defaults",
666    include_dirs: [
667        "external/python/cpython3/Include",
668    ],
669    target: {
670        android: {
671            include_dirs: ["external/python/cpython3/android/bionic/pyconfig"],
672        },
673        android_arm: {
674            cflags: ["-DSOABI=\"cpython-38android-arm-android-bionic\""],
675            suffix: ".cpython-38android-arm-android-bionic",
676        },
677        android_arm64: {
678            cflags: ["-DSOABI=\"cpython-38android-arm64-android-bionic\""],
679            suffix: ".cpython-38android-arm64-android-bionic",
680        },
681        android_x86: {
682            cflags: ["-DSOABI=\"cpython-38android-x86-android-bionic\""],
683            suffix: ".cpython-38android-x86-android-bionic",
684        },
685        android_x86_64: {
686            cflags: ["-DSOABI=\"cpython-38android-x86_64-android-bionic\""],
687            suffix: ".cpython-38android-x86_64-android-bionic",
688        },
689        // Regenerate include dirs with android_regen.sh
690        darwin_x86_64: {
691            include_dirs: ["external/python/cpython3/android/darwin_x86_64/pyconfig"],
692            cflags: [
693                "-Wno-deprecated-declarations",
694                "-Wno-pointer-arith",
695                "-DSOABI=\"cpython-38android-x86_64-darwin\"",
696            ],
697            suffix: ".cpython-38android-x86_64-darwin",
698        },
699        linux_bionic: {
700            // NB linux_bionic is a 'host' architecture but it uses the bionic libc like 'android'
701            // targets so use the android pyconfig.
702            include_dirs: ["external/python/cpython3/android/bionic/pyconfig"],
703            cflags: ["-DSOABI=\"cpython-38android-x86_64-linux-bionic\""],
704            suffix: ".cpython-38android-x86_64-linux-bionic",
705        },
706        linux_glibc_x86: {
707            enabled: false,
708        },
709        linux_glibc_x86_64: {
710            include_dirs: ["external/python/cpython3/android/linux_x86_64/pyconfig"],
711            cflags: ["-DSOABI=\"cpython-38android-x86_64-linux-gnu\""],
712            // Commenting out the Linux suffix so that cpython-38-x86_64-linux-gnu
713            // Python 3.8 can also import the untagged .so library per PEP 3149
714            // Keep this change until Android py3-cmd can run ACTS, gRPC and can
715            // Export Python native symbols such as PyType_Type
716            // suffix: ".cpython-38android-x86_64-linux-gnu",
717        },
718        windows: {
719            enabled: false,
720        },
721    },
722    allow_undefined_symbols: true,
723}
724
725cc_library_host_shared {
726    name: "bluetooth_packets_python3",
727    defaults: [
728        "gd_defaults",
729        "bluetooth_py3_native_extension_defaults",
730    ],
731    srcs: [
732        "common/strings.cc",
733        "packet/python3_module.cc",
734        "l2cap/fcs.cc",
735        ":BluetoothPacketSources",
736        "hci/address.cc",
737        "hci/class_of_device.cc",
738
739    ],
740    generated_headers: [
741        "BluetoothGeneratedPackets_h",
742    ],
743    generated_sources: [
744        "BluetoothGeneratedPackets_python3_cc",
745    ],
746    header_libs: [
747        "pybind11_headers",
748    ],
749    cflags: [
750        "-fexceptions",
751    ],
752    rtti: true,
753}
754