Android.bp 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. // Copyright (C) 2009 The Android Open Source Project
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. subdirs = [
  15. "vts/performance",
  16. ]
  17. cc_defaults {
  18. name: "libhwbinder_defaults",
  19. export_include_dirs: ["include"],
  20. include_dirs: ["frameworks/native/include"],
  21. sanitize: {
  22. misc_undefined: ["integer"],
  23. },
  24. srcs: [
  25. "Binder.cpp",
  26. "BpHwBinder.cpp",
  27. "BufferedTextOutput.cpp",
  28. "Debug.cpp",
  29. "IInterface.cpp",
  30. "IPCThreadState.cpp",
  31. "Parcel.cpp",
  32. "ProcessState.cpp",
  33. "Static.cpp",
  34. "TextOutput.cpp",
  35. ],
  36. product_variables: {
  37. binder32bit: {
  38. cflags: ["-DBINDER_IPC_32BIT=1"],
  39. },
  40. },
  41. cflags: [
  42. "-Wall",
  43. "-Werror",
  44. ],
  45. }
  46. cc_defaults {
  47. name: "libhwbinder-impl-shared-libs",
  48. defaults: ["libhwbinder-impl-shared-libs-no-vndk-private"],
  49. shared_libs: [
  50. "libbinderthreadstate",
  51. ],
  52. }
  53. cc_defaults {
  54. name: "libhwbinder-impl-shared-libs-no-vndk-private",
  55. shared_libs: [
  56. "libbase",
  57. "liblog",
  58. "libcutils",
  59. "libutils",
  60. ],
  61. export_shared_lib_headers: [
  62. "libbase",
  63. "libutils",
  64. ],
  65. }
  66. // WARNING: this should no longer be used
  67. cc_library {
  68. name: "libhwbinder",
  69. recovery_available: true,
  70. vendor_available: true,
  71. vndk: {
  72. enabled: true,
  73. support_system_process: true,
  74. },
  75. export_include_dirs: ["include"],
  76. }
  77. // Combined into libhidlbase for efficiency.
  78. // Used as shared library to provide headers for libhidltransport-impl-internal.
  79. cc_library_static {
  80. name: "libhwbinder-impl-internal",
  81. // TODO(b/135299443): allow this library to link against vndk-private libs
  82. // and instead rely on the fact that users of this static library must be
  83. // vndk (since they must use libbinderthreadstate).
  84. include_dirs: ["frameworks/native/libs/binderthreadstate/include/"],
  85. defaults: [
  86. "libhwbinder_defaults",
  87. "libhwbinder-impl-shared-libs-no-vndk-private",
  88. "hwbinder_pgo",
  89. "hwbinder_lto",
  90. ],
  91. recovery_available: true,
  92. vendor_available: true,
  93. }
  94. // Explicitly provide a no lto, no PGO variant, to workaround the issue that we
  95. // can't detect non-lto users of the module in Android.mk.
  96. // TODO(b/135558503): remove
  97. cc_library {
  98. name: "libhwbinder_noltopgo",
  99. defaults: [
  100. "libhwbinder_defaults",
  101. "libhwbinder-impl-shared-libs",
  102. ],
  103. recovery_available: true,
  104. vendor_available: true,
  105. vndk: {
  106. enabled: true,
  107. support_system_process: true,
  108. },
  109. }
  110. // Only libhwbinder_benchmark needs to have pgo enabled. When all places
  111. // support having PGO selectively enabled, all places can use libhwbinder.
  112. //
  113. // http://b/77320844
  114. cc_library_static {
  115. name: "libhwbinder_pgo-impl-internal",
  116. defaults: [
  117. "libhwbinder_defaults",
  118. "libhwbinder-impl-shared-libs",
  119. "hwbinder_benchmark_pgo",
  120. "hwbinder_lto",
  121. ],
  122. }
  123. // Provide pgo property to build hwbinder with PGO
  124. cc_defaults {
  125. name: "hwbinder_pgo",
  126. pgo: {
  127. instrumentation: true,
  128. profile_file: "hwbinder/hwbinder.profdata",
  129. benchmarks: ["hwbinder"],
  130. enable_profile_use: true,
  131. },
  132. }
  133. cc_defaults {
  134. name: "hwbinder_benchmark_pgo",
  135. pgo: {
  136. instrumentation: true,
  137. profile_file: "hwbinder/hwbinder.profdata",
  138. benchmarks: ["hwbinder_benchmark"],
  139. enable_profile_use: true,
  140. },
  141. }
  142. // Provide lto property to build hwbinder with LTO
  143. cc_defaults {
  144. name: "hwbinder_lto",
  145. target: {
  146. android: {
  147. lto: {
  148. thin: true,
  149. },
  150. },
  151. },
  152. }