• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1bootstrap_go_package {
2    name: "soong-fluoride",
3    pkgPath: "android/soong/fluoride",
4    deps: [
5        "blueprint",
6        "blueprint-pathtools",
7        "soong",
8        "soong-android",
9        "soong-cc",
10    ],
11    srcs: [
12        "fluoride.go",
13    ],
14    pluginFor: ["soong_build"],
15}
16
17fluoride_defaults {
18    name: "libchrome_support_defaults",
19    shared_libs: ["libchrome"],
20    cflags: [
21        "-Wall",
22        "-Wextra",
23        "-Werror",
24    ],
25    target: {
26        darwin: {
27            enabled: false,
28        },
29    },
30}
31
32// Fuzzable defaults are the subset of defaults that are used in fuzzing, which
33// requires no shared libraries, and no explicit sanitization.
34fluoride_defaults {
35    name: "fluoride_types_defaults_fuzzable",
36    cflags: [
37        "-DEXPORT_SYMBOL=__attribute__((visibility(\"default\")))",
38        "-fvisibility=hidden",
39        // struct BT_HDR is defined as a variable-size header in a struct.
40        "-Wno-gnu-variable-sized-type-not-at-end",
41        // there are too many unused parameters in all the code.
42        "-Wno-unused-parameter",
43        "-DLOG_NDEBUG=1",
44    ],
45    conlyflags: [
46        "-std=c99",
47    ],
48    product_variables: {
49        debuggable: {
50            cflags: [
51                "-DBLUEDROID_DEBUG",
52            ],
53        },
54    },
55}
56
57fluoride_defaults {
58    name: "fluoride_types_defaults",
59    defaults: [
60        "fluoride_types_defaults_fuzzable",
61        "libchrome_support_defaults"
62    ],
63}
64
65fluoride_defaults {
66    name: "fluoride_defaults_fuzzable",
67    target: {
68        android: {
69            test_config_template: ":BluetoothTestConfigTemplate",
70        },
71    },
72    defaults: ["fluoride_types_defaults_fuzzable"],
73    header_libs: ["libbluetooth_headers"],
74    static_libs: [
75        "libbluetooth-types",
76        "libbt-platform-protos-lite",
77    ],
78    cpp_std: "c++17",
79    sanitize: {
80        misc_undefined: ["bounds"],
81    },
82}
83
84fluoride_defaults {
85    name: "fluoride_defaults",
86    defaults: ["fluoride_defaults_fuzzable", "fluoride_types_defaults"],
87    shared_libs: ["libstatslog"],
88    sanitize: {
89        misc_undefined: ["bounds"],
90    },
91}
92
93// Enables code coverage for a set of source files. Must be combined with
94// "clang_coverage_bin" in order to work. See //test/gen_coverage.py for more information
95// on generating code coverage.
96cc_defaults {
97    name: "clang_file_coverage",
98    target: {
99        host: {
100            clang_cflags: [
101                "-fprofile-instr-generate",
102                "-fcoverage-mapping",
103            ],
104        },
105    },
106}
107
108// Enabled code coverage on a binary. These flags allow libraries that were
109// compiled with "clang_file_coverage" to be properly linked together in
110// order to create a binary that will create a profraw file when ran. Note
111// these flags themselves don't enable code coverage for the source files
112// compiled in the binary. See //test/gen_coverage.py for more information
113// on generating code coverage.
114cc_defaults {
115    name: "clang_coverage_bin",
116    target: {
117        host: {
118            ldflags: [
119                "-fprofile-instr-generate",
120                "-fcoverage-mapping",
121            ],
122        },
123    },
124}
125