blob: 2f8cf54d61800d7744df8180a06fbbc4c099f3f4 [file] [log] [blame]
Bob Badour92ecf7c2021-02-12 18:05:29 -08001package {
Etienne Ruffieux917abc32022-02-28 14:07:17 +00002 default_visibility: [":__subpackages__"],
Bob Badour92ecf7c2021-02-12 18:05:29 -08003 default_applicable_licenses: ["system_bt_license"],
4}
5
6// Added automatically by a large-scale-change that took the approach of
7// 'apply every license found to every target'. While this makes sure we respect
8// every license restriction, it may not be entirely correct.
9//
10// e.g. GPL in an MIT project might only apply to the contrib/ directory.
11//
12// Please consider splitting the single license below into multiple licenses,
13// taking care not to lose any license_kind information, and overriding the
14// default license using the 'licenses: [...]' property on targets as needed.
15//
16// For unused files, consider creating a 'fileGroup' with "//visibility:private"
17// to attach the license to, and including a comment whether the files may be
18// used in the current project.
19// See: http://go/android-license-faq
20license {
21 name: "system_bt_license",
22 visibility: [":__subpackages__"],
23 license_kinds: [
24 "SPDX-license-identifier-Apache-2.0",
25 "SPDX-license-identifier-BSD",
26 "SPDX-license-identifier-MIT",
27 "legacy_unencumbered",
28 ],
29 license_text: [
30 "NOTICE",
31 ],
32}
33
Jack Hecac30a22018-08-28 18:28:55 -070034filegroup {
Colin Cross03e29e52019-05-23 14:12:59 -070035 name: "BluetoothTestConfigTemplate",
36 srcs: [
37 "AndroidTestTemplate.xml",
38 ],
Jack Hecac30a22018-08-28 18:28:55 -070039}
David Duartea84ffd12023-03-28 17:58:57 +000040
41filegroup {
42 name: "BluetoothGTestForce32ConfigTemplate",
43 srcs: [
44 "AndroidGTestForce32Template.xml",
45 ],
46}
47
David Duarte4043a702023-06-04 16:44:03 +000048// This default contains properties that should be common to all the cc targets
49// developed by the Bluetooth team.
50//
51// Be careful when adding new properties here:
52// - The option should not impact negatively any target, for example "-Wno-*"
53// options should not be added here but instead on every targets needing
54// them to avoid allowing adding new warnings in targets that didn't contained
55// them (you can use the bpmodify tool to ease the work of adding this warning
56// everywhere) and also allows cleaning them one at a time.
57//
58// - The option should apply to all the c/c++ code developed by the Bluetooth team:
59// test, tools, fuzzers, etc, not only production targets, if you need to add an option
60// for a subset of Bluetooth cc targets you should look at the defaults including this
61// defaults like "fluoride_defaults" and "gd_defaults".
62//
63// - Try to keep the name as precise as possible to document to the dependent of what
64// this default contains. This also means that if you add a new option that isn't
65// documented by the name of this default, rename it.
66//
67// - Try avoiding adding option that would not fit "future" targets, for exemple dependencies,
68// even if every modules of Bluetooth depends on a specific dependency it should be left out
69// from this default to not push it for future targets that might not need it.
70cc_defaults {
71 name: "bluetooth_cflags",
72 cflags: [
73 "-Wall",
74 "-Werror",
75 "-Wextra",
William Escande27297182023-10-09 17:15:04 -070076 // Override global.go that demote the error to a warning
77 "-Werror=reorder-init-list",
David Duarte4043a702023-06-04 16:44:03 +000078 ],
David Duarte19954d12023-08-01 14:07:56 +000079 c_std: "c99",
80 cpp_std: "c++17",
David Duarte4043a702023-06-04 16:44:03 +000081}
82
David Duartea84ffd12023-03-28 17:58:57 +000083// Address Sanitizer is flaky on Android x86_64 binaries but it's not on x86
84// binaries.
85// This default workaround the x86_64 ASAN flakyness by running 32bit binaries
86// on 64bit targets.
87// TODO(b/154347133): Remove this workaround
88cc_defaults {
89 name: "bluetooth_gtest_x86_asan_workaround",
90 target: {
91 android_x86: {
92 test_config_template: ":BluetoothGTestForce32ConfigTemplate",
93 },
94 android_x86_64: {
95 enabled: false,
96 },
97 },
98}