blob: b3e8a125853f069e251538de77261e69fd57c6bc [file] [log] [blame]
Zach Johnson3a770032019-03-27 19:15:38 -07001cc_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 },
21 cpp_std: "c++17",
22 cflags: [
23 "-DEXPORT_SYMBOL=__attribute__((visibility(\"default\")))",
24 "-fvisibility=hidden",
25 "-DLOG_NDEBUG=1",
26 "-DGOOGLE_PROTOBUF_NO_RTTI",
27 ],
28 conlyflags: [
29 "-std=c99",
30 ],
31 sanitize: {
32 misc_undefined: ["bounds"],
33 },
34}
35
36// Enables code coverage for a set of source files. Must be combined with
37// "clang_coverage_bin" in order to work. See //test/gen_coverage.py for more information
38// on generating code coverage.
39cc_defaults {
40 name: "gd_clang_file_coverage",
41 target: {
42 host: {
43 clang_cflags: [
44 "-fprofile-instr-generate",
45 "-fcoverage-mapping",
46 ],
47 },
48 },
49}
50
51// Enabled code coverage on a binary. These flags allow libraries that were
52// compiled with "clang_file_coverage" to be properly linked together in
53// order to create a binary that will create a profraw file when ran. Note
54// these flags themselves don't enable code coverage for the source files
55// compiled in the binary. See //test/gen_coverage.py for more information
56// on generating code coverage.
57cc_defaults {
58 name: "gd_clang_coverage_bin",
59 target: {
60 host: {
61 ldflags: [
62 "-fprofile-instr-generate",
63 "-fcoverage-mapping",
64 ],
65 },
66 },
67}
68
69cc_library {
70 name: "libbluetooth_gd",
Hansong Zhanga25f84d2019-03-19 16:17:42 -070071 defaults: [
Zach Johnson3a770032019-03-27 19:15:38 -070072 "gd_defaults",
73 "gd_clang_file_coverage",
Hansong Zhanga25f84d2019-03-19 16:17:42 -070074 ],
75 host_supported: true,
Zach Johnson3a770032019-03-27 19:15:38 -070076 target: {
77 linux: {
78 srcs: [
79 ":BluetoothOsSources_linux_generic",
80 ]
81 }
82 },
Hansong Zhanga25f84d2019-03-19 16:17:42 -070083}
84
85cc_test {
Zach Johnson3a770032019-03-27 19:15:38 -070086 name: "bluetooth_test_gd",
Hansong Zhanga25f84d2019-03-19 16:17:42 -070087 test_suites: ["device-tests"],
88 defaults: [
Zach Johnson3a770032019-03-27 19:15:38 -070089 "gd_defaults",
90 "gd_clang_coverage_bin",
Hansong Zhanga25f84d2019-03-19 16:17:42 -070091 ],
92 host_supported: true,
Zach Johnson3a770032019-03-27 19:15:38 -070093 target: {
94 linux: {
95 srcs: [
96 ":BluetoothOsTestSources_linux_generic",
97 ]
98 }
99 },
Hansong Zhanga25f84d2019-03-19 16:17:42 -0700100 static_libs : [
Zach Johnson3a770032019-03-27 19:15:38 -0700101 "libbluetooth_gd",
Hansong Zhanga25f84d2019-03-19 16:17:42 -0700102 ],
103 sanitize: {
104 cfi: false,
105 },
106}
Jack Hef4e24712019-04-01 16:20:14 -0700107
108cc_benchmark {
109 name: "bluetooth_benchmark_gd",
110 defaults: ["gd_defaults"],
111 host_supported: true,
112 srcs: [
113 "benchmark.cc",
114 ":BluetoothOsBenchmarkSources",
115 ],
116 static_libs : [
117 "libbluetooth_gd",
118 ],
119}