Jack He | e2eeff4 | 2016-12-07 18:25:17 -0800 | [diff] [blame] | 1 | bootstrap_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 | |
| 17 | fluoride_defaults { |
Myles Watson | 65d24fb | 2018-02-13 10:33:54 -0800 | [diff] [blame] | 18 | name: "libchrome_support_defaults", |
| 19 | shared_libs: ["libchrome"], |
Jack He | e2eeff4 | 2016-12-07 18:25:17 -0800 | [diff] [blame] | 20 | cflags: [ |
Jack He | e2eeff4 | 2016-12-07 18:25:17 -0800 | [diff] [blame] | 21 | "-Wall", |
| 22 | "-Wextra", |
| 23 | "-Werror", |
Myles Watson | 65d24fb | 2018-02-13 10:33:54 -0800 | [diff] [blame] | 24 | ], |
| 25 | target: { |
| 26 | darwin: { |
| 27 | enabled: false, |
| 28 | }, |
| 29 | }, |
| 30 | } |
| 31 | |
Mitch Phillips | ee770ca | 2019-10-16 09:50:45 -0700 | [diff] [blame] | 32 | // Fuzzable defaults are the subset of defaults that are used in fuzzing, which |
| 33 | // requires no shared libraries, and no explicit sanitization. |
Myles Watson | 65d24fb | 2018-02-13 10:33:54 -0800 | [diff] [blame] | 34 | fluoride_defaults { |
Mitch Phillips | ee770ca | 2019-10-16 09:50:45 -0700 | [diff] [blame] | 35 | name: "fluoride_types_defaults_fuzzable", |
Myles Watson | 65d24fb | 2018-02-13 10:33:54 -0800 | [diff] [blame] | 36 | cflags: [ |
| 37 | "-DEXPORT_SYMBOL=__attribute__((visibility(\"default\")))", |
| 38 | "-fvisibility=hidden", |
Jack He | e2eeff4 | 2016-12-07 18:25:17 -0800 | [diff] [blame] | 39 | // struct BT_HDR is defined as a variable-size header in a struct. |
| 40 | "-Wno-gnu-variable-sized-type-not-at-end", |
Jack He | e2eeff4 | 2016-12-07 18:25:17 -0800 | [diff] [blame] | 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: { |
Jakub Pawlowski | ba993e9 | 2017-02-09 16:46:45 -0800 | [diff] [blame] | 50 | cflags: [ |
| 51 | "-DBLUEDROID_DEBUG", |
Jakub Pawlowski | ba993e9 | 2017-02-09 16:46:45 -0800 | [diff] [blame] | 52 | ], |
Jack He | e2eeff4 | 2016-12-07 18:25:17 -0800 | [diff] [blame] | 53 | }, |
| 54 | }, |
Jack He | e2eeff4 | 2016-12-07 18:25:17 -0800 | [diff] [blame] | 55 | } |
Jakub Pawlowski | b707f44 | 2017-07-03 15:39:36 -0700 | [diff] [blame] | 56 | |
| 57 | fluoride_defaults { |
Mitch Phillips | ee770ca | 2019-10-16 09:50:45 -0700 | [diff] [blame] | 58 | name: "fluoride_types_defaults", |
| 59 | defaults: [ |
| 60 | "fluoride_types_defaults_fuzzable", |
| 61 | "libchrome_support_defaults" |
| 62 | ], |
| 63 | } |
| 64 | |
| 65 | fluoride_defaults { |
| 66 | name: "fluoride_defaults_fuzzable", |
Dan Shi | 0215545 | 2018-12-14 09:56:36 -0800 | [diff] [blame] | 67 | target: { |
| 68 | android: { |
| 69 | test_config_template: ":BluetoothTestConfigTemplate", |
Colin Cross | 6208435 | 2019-05-23 14:12:59 -0700 | [diff] [blame] | 70 | }, |
Dan Shi | 0215545 | 2018-12-14 09:56:36 -0800 | [diff] [blame] | 71 | }, |
Mitch Phillips | ee770ca | 2019-10-16 09:50:45 -0700 | [diff] [blame] | 72 | defaults: ["fluoride_types_defaults_fuzzable"], |
Jakub Pawlowski | e56fabc | 2017-10-19 00:26:09 -0700 | [diff] [blame] | 73 | header_libs: ["libbluetooth_headers"], |
Jakub Pawlowski | b707f44 | 2017-07-03 15:39:36 -0700 | [diff] [blame] | 74 | static_libs: [ |
| 75 | "libbluetooth-types", |
Jack He | 9d9df72 | 2018-12-20 15:46:17 -0800 | [diff] [blame] | 76 | "libbt-platform-protos-lite", |
Jakub Pawlowski | b707f44 | 2017-07-03 15:39:36 -0700 | [diff] [blame] | 77 | ], |
Ajay Panicker | 96bcf14 | 2018-09-17 11:35:24 -0700 | [diff] [blame] | 78 | cpp_std: "c++17", |
Ivan Lozano | be596a8 | 2018-09-28 11:23:51 -0700 | [diff] [blame] | 79 | sanitize: { |
| 80 | misc_undefined: ["bounds"], |
| 81 | }, |
Jakub Pawlowski | b707f44 | 2017-07-03 15:39:36 -0700 | [diff] [blame] | 82 | } |
Ajay Panicker | ff48ce8 | 2018-09-20 14:39:00 -0700 | [diff] [blame] | 83 | |
Mitch Phillips | ee770ca | 2019-10-16 09:50:45 -0700 | [diff] [blame] | 84 | fluoride_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 Panicker | ff48ce8 | 2018-09-20 14:39:00 -0700 | [diff] [blame] | 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. |
| 96 | cc_defaults { |
| 97 | name: "clang_file_coverage", |
| 98 | target: { |
Hansong Zhang | 262bff9 | 2019-03-27 15:49:13 -0700 | [diff] [blame] | 99 | host: { |
Ajay Panicker | ff48ce8 | 2018-09-20 14:39:00 -0700 | [diff] [blame] | 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. |
| 114 | cc_defaults { |
| 115 | name: "clang_coverage_bin", |
| 116 | target: { |
Hansong Zhang | 262bff9 | 2019-03-27 15:49:13 -0700 | [diff] [blame] | 117 | host: { |
Ajay Panicker | ff48ce8 | 2018-09-20 14:39:00 -0700 | [diff] [blame] | 118 | ldflags: [ |
| 119 | "-fprofile-instr-generate", |
| 120 | "-fcoverage-mapping", |
| 121 | ], |
| 122 | }, |
| 123 | }, |
| 124 | } |