Android.bp 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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. // Enables code coverage for a set of source files. Must be combined with
  36. // "clang_coverage_bin" in order to work. See //test/gen_coverage.py for more information
  37. // on generating code coverage.
  38. cc_defaults {
  39. name: "gd_clang_file_coverage",
  40. target: {
  41. host: {
  42. clang_cflags: [
  43. "-fprofile-instr-generate",
  44. "-fcoverage-mapping",
  45. ],
  46. },
  47. },
  48. }
  49. // Enabled code coverage on a binary. These flags allow libraries that were
  50. // compiled with "clang_file_coverage" to be properly linked together in
  51. // order to create a binary that will create a profraw file when ran. Note
  52. // these flags themselves don't enable code coverage for the source files
  53. // compiled in the binary. See //test/gen_coverage.py for more information
  54. // on generating code coverage.
  55. cc_defaults {
  56. name: "gd_clang_coverage_bin",
  57. target: {
  58. host: {
  59. ldflags: [
  60. "-fprofile-instr-generate",
  61. "-fcoverage-mapping",
  62. ],
  63. },
  64. },
  65. }
  66. cc_library {
  67. name: "libbluetooth_gd",
  68. defaults: [
  69. "gd_defaults",
  70. "gd_clang_file_coverage",
  71. ],
  72. host_supported: true,
  73. target: {
  74. linux: {
  75. srcs: [
  76. ":BluetoothOsSources_linux_generic",
  77. ]
  78. }
  79. },
  80. srcs: [
  81. ":BluetoothCommonSources",
  82. ":BluetoothPacketSources",
  83. ]
  84. }
  85. cc_test {
  86. name: "bluetooth_test_gd",
  87. test_suites: ["device-tests"],
  88. defaults: [
  89. "gd_defaults",
  90. "gd_clang_coverage_bin",
  91. ],
  92. host_supported: true,
  93. target: {
  94. linux: {
  95. srcs: [
  96. ":BluetoothOsTestSources_linux_generic",
  97. ]
  98. }
  99. },
  100. srcs: [
  101. ":BluetoothCommonTestSources",
  102. ":BluetoothPacketTestSources",
  103. ],
  104. static_libs : [
  105. "libbluetooth_gd",
  106. ],
  107. sanitize: {
  108. cfi: false,
  109. },
  110. }
  111. cc_benchmark {
  112. name: "bluetooth_benchmark_gd",
  113. defaults: ["gd_defaults"],
  114. host_supported: true,
  115. srcs: [
  116. "benchmark.cc",
  117. ":BluetoothOsBenchmarkSources",
  118. ],
  119. static_libs : [
  120. "libbluetooth_gd",
  121. ],
  122. }