Android.bp 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. //
  2. // Copyright (C) 2018 The Android Open Source Project
  3. //
  4. // Licensed under the Apache License, Version 2.0 (the "License");
  5. // you may not use this file except in compliance with the License.
  6. // You may obtain a copy of the License at
  7. //
  8. // http://www.apache.org/licenses/LICENSE-2.0
  9. //
  10. // Unless required by applicable law or agreed to in writing, software
  11. // distributed under the License is distributed on an "AS IS" BASIS,
  12. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. // See the License for the specific language governing permissions and
  14. // limitations under the License.
  15. //
  16. cc_library_headers {
  17. name: "libbpf_android_headers",
  18. vendor_available: false,
  19. host_supported: false,
  20. export_include_dirs: ["include"],
  21. target: {
  22. linux_bionic: {
  23. enabled: true,
  24. },
  25. },
  26. }
  27. cc_library {
  28. name: "libbpf_android",
  29. vendor_available: false,
  30. host_supported: false,
  31. target: {
  32. android: {
  33. srcs: [
  34. "BpfUtils.cpp",
  35. "Loader.cpp",
  36. ],
  37. sanitize: {
  38. misc_undefined: ["integer"],
  39. },
  40. },
  41. },
  42. shared_libs: [
  43. "libbase",
  44. "libutils",
  45. "libprocessgroup",
  46. "liblog",
  47. "libnetdutils",
  48. "libbpf",
  49. ],
  50. header_libs: [
  51. "libbpf_android_headers"
  52. ],
  53. export_header_lib_headers: ["libbpf_android_headers"],
  54. local_include_dirs: ["include"],
  55. defaults: ["bpf_defaults"],
  56. cflags: [
  57. "-Werror",
  58. "-Wall",
  59. "-Wextra",
  60. ],
  61. }
  62. cc_test {
  63. name: "libbpf_android_test",
  64. srcs: [
  65. "BpfMapTest.cpp",
  66. ],
  67. defaults: ["bpf_defaults"],
  68. cflags: [
  69. "-Wall",
  70. "-Werror",
  71. "-Wno-error=unused-variable",
  72. ],
  73. static_libs: ["libgmock"],
  74. shared_libs: [
  75. "libbpf_android",
  76. "libbase",
  77. "liblog",
  78. "libnetdutils",
  79. "libutils",
  80. ],
  81. }
  82. cc_test {
  83. name: "libbpf_load_test",
  84. srcs: [
  85. "BpfLoadTest.cpp",
  86. ],
  87. defaults: ["bpf_defaults"],
  88. cflags: [
  89. "-Wall",
  90. "-Werror",
  91. "-Wno-error=unused-variable",
  92. ],
  93. static_libs: ["libgmock"],
  94. shared_libs: [
  95. "libbpf_android",
  96. "libbpf",
  97. "libbase",
  98. "liblog",
  99. "libnetdutils",
  100. "libutils",
  101. ],
  102. required: [
  103. "bpf_load_tp_prog.o",
  104. ],
  105. }