blob: 32c0f31c03d75377bd886d8ce9883da1cace7013 [file] [log] [blame]
Jack Hee2eeff42016-12-07 18:25:17 -08001bootstrap_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 {
Myles Watson65d24fb2018-02-13 10:33:54 -080018 name: "libchrome_support_defaults",
19 shared_libs: ["libchrome"],
Jack Hee2eeff42016-12-07 18:25:17 -080020 cflags: [
Jack Hee2eeff42016-12-07 18:25:17 -080021 "-Wall",
22 "-Wextra",
23 "-Werror",
Myles Watson65d24fb2018-02-13 10:33:54 -080024 ],
25 target: {
26 darwin: {
27 enabled: false,
28 },
29 },
30}
31
Mitch Phillipsee770ca2019-10-16 09:50:45 -070032// Fuzzable defaults are the subset of defaults that are used in fuzzing, which
33// requires no shared libraries, and no explicit sanitization.
Myles Watson65d24fb2018-02-13 10:33:54 -080034fluoride_defaults {
Mitch Phillipsee770ca2019-10-16 09:50:45 -070035 name: "fluoride_types_defaults_fuzzable",
Myles Watson65d24fb2018-02-13 10:33:54 -080036 cflags: [
37 "-DEXPORT_SYMBOL=__attribute__((visibility(\"default\")))",
38 "-fvisibility=hidden",
Jack Hee2eeff42016-12-07 18:25:17 -080039 // struct BT_HDR is defined as a variable-size header in a struct.
40 "-Wno-gnu-variable-sized-type-not-at-end",
Jack Hee2eeff42016-12-07 18:25:17 -080041 // 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: {
Jakub Pawlowskiba993e92017-02-09 16:46:45 -080050 cflags: [
51 "-DBLUEDROID_DEBUG",
Jakub Pawlowskiba993e92017-02-09 16:46:45 -080052 ],
Jack Hee2eeff42016-12-07 18:25:17 -080053 },
54 },
Jack Hee2eeff42016-12-07 18:25:17 -080055}
Jakub Pawlowskib707f442017-07-03 15:39:36 -070056
57fluoride_defaults {
Mitch Phillipsee770ca2019-10-16 09:50:45 -070058 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",
Dan Shi02155452018-12-14 09:56:36 -080067 target: {
68 android: {
69 test_config_template: ":BluetoothTestConfigTemplate",
Colin Cross62084352019-05-23 14:12:59 -070070 },
Dan Shi02155452018-12-14 09:56:36 -080071 },
Mitch Phillipsee770ca2019-10-16 09:50:45 -070072 defaults: ["fluoride_types_defaults_fuzzable"],
Jakub Pawlowskie56fabc2017-10-19 00:26:09 -070073 header_libs: ["libbluetooth_headers"],
Jakub Pawlowskib707f442017-07-03 15:39:36 -070074 static_libs: [
75 "libbluetooth-types",
Jack He9d9df722018-12-20 15:46:17 -080076 "libbt-platform-protos-lite",
Jakub Pawlowskib707f442017-07-03 15:39:36 -070077 ],
Ajay Panicker96bcf142018-09-17 11:35:24 -070078 cpp_std: "c++17",
Ivan Lozanobe596a82018-09-28 11:23:51 -070079 sanitize: {
80 misc_undefined: ["bounds"],
81 },
Jakub Pawlowskib707f442017-07-03 15:39:36 -070082}
Ajay Panickerff48ce82018-09-20 14:39:00 -070083
Mitch Phillipsee770ca2019-10-16 09:50:45 -070084fluoride_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
Ajay Panickerff48ce82018-09-20 14:39:00 -070093// 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: {
Hansong Zhang262bff92019-03-27 15:49:13 -070099 host: {
Ajay Panickerff48ce82018-09-20 14:39:00 -0700100 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: {
Hansong Zhang262bff92019-03-27 15:49:13 -0700117 host: {
Ajay Panickerff48ce82018-09-20 14:39:00 -0700118 ldflags: [
119 "-fprofile-instr-generate",
120 "-fcoverage-mapping",
121 ],
122 },
123 },
124}