• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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    },
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",
71    defaults: [
72        "gd_defaults",
73        "gd_clang_file_coverage",
74    ],
75    host_supported: true,
76    target: {
77        linux: {
78            srcs: [
79                ":BluetoothOsSources_linux_generic",
80            ]
81        }
82    },
83    srcs: [
84        ":BluetoothCommonSources",
85        ":BluetoothPacketSources",
86    ]
87}
88
89cc_test {
90    name: "bluetooth_test_gd",
91    test_suites: ["device-tests"],
92    defaults: [
93        "gd_defaults",
94        "gd_clang_coverage_bin",
95    ],
96    host_supported: true,
97    target: {
98        linux: {
99            srcs: [
100                ":BluetoothOsTestSources_linux_generic",
101            ]
102        }
103    },
104    srcs: [
105        ":BluetoothCommonTestSources",
106        ":BluetoothPacketTestSources",
107    ],
108    static_libs : [
109        "libbluetooth_gd",
110    ],
111    sanitize: {
112        cfi: false,
113    },
114}
115
116cc_benchmark {
117    name: "bluetooth_benchmark_gd",
118    defaults: ["gd_defaults"],
119    host_supported: true,
120    srcs: [
121        "benchmark.cc",
122        ":BluetoothOsBenchmarkSources",
123    ],
124    static_libs : [
125            "libbluetooth_gd",
126    ],
127}
128