Zach Johnson | 3a77003 | 2019-03-27 19:15:38 -0700 | [diff] [blame] | 1 | cc_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. |
| 39 | cc_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. |
| 57 | cc_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 | |
| 69 | cc_library { |
| 70 | name: "libbluetooth_gd", |
Hansong Zhang | a25f84d | 2019-03-19 16:17:42 -0700 | [diff] [blame] | 71 | defaults: [ |
Zach Johnson | 3a77003 | 2019-03-27 19:15:38 -0700 | [diff] [blame] | 72 | "gd_defaults", |
| 73 | "gd_clang_file_coverage", |
Hansong Zhang | a25f84d | 2019-03-19 16:17:42 -0700 | [diff] [blame] | 74 | ], |
| 75 | host_supported: true, |
Zach Johnson | 3a77003 | 2019-03-27 19:15:38 -0700 | [diff] [blame] | 76 | target: { |
| 77 | linux: { |
| 78 | srcs: [ |
| 79 | ":BluetoothOsSources_linux_generic", |
| 80 | ] |
| 81 | } |
| 82 | }, |
Hansong Zhang | a25f84d | 2019-03-19 16:17:42 -0700 | [diff] [blame] | 83 | } |
| 84 | |
| 85 | cc_test { |
Zach Johnson | 3a77003 | 2019-03-27 19:15:38 -0700 | [diff] [blame] | 86 | name: "bluetooth_test_gd", |
Hansong Zhang | a25f84d | 2019-03-19 16:17:42 -0700 | [diff] [blame] | 87 | test_suites: ["device-tests"], |
| 88 | defaults: [ |
Zach Johnson | 3a77003 | 2019-03-27 19:15:38 -0700 | [diff] [blame] | 89 | "gd_defaults", |
| 90 | "gd_clang_coverage_bin", |
Hansong Zhang | a25f84d | 2019-03-19 16:17:42 -0700 | [diff] [blame] | 91 | ], |
| 92 | host_supported: true, |
Zach Johnson | 3a77003 | 2019-03-27 19:15:38 -0700 | [diff] [blame] | 93 | target: { |
| 94 | linux: { |
| 95 | srcs: [ |
| 96 | ":BluetoothOsTestSources_linux_generic", |
| 97 | ] |
| 98 | } |
| 99 | }, |
Hansong Zhang | a25f84d | 2019-03-19 16:17:42 -0700 | [diff] [blame] | 100 | static_libs : [ |
Zach Johnson | 3a77003 | 2019-03-27 19:15:38 -0700 | [diff] [blame] | 101 | "libbluetooth_gd", |
Hansong Zhang | a25f84d | 2019-03-19 16:17:42 -0700 | [diff] [blame] | 102 | ], |
| 103 | sanitize: { |
| 104 | cfi: false, |
| 105 | }, |
| 106 | } |
Jack He | f4e2471 | 2019-04-01 16:20:14 -0700 | [diff] [blame^] | 107 | |
| 108 | cc_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 | } |