BUILD.hiredis 1017 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. COPTS = [] + select({
  2. "@bazel_tools//src/conditions:windows": [
  3. "-D_CRT_DECLARE_NONSTDC_NAMES=0", # don't define off_t, to avoid conflicts
  4. ],
  5. "//conditions:default": [
  6. ],
  7. }) + select({
  8. "@//:msvc-cl": [
  9. ],
  10. "//conditions:default": [
  11. # Old versions of GCC (e.g. 4.9.2) can fail to compile Redis's C without this.
  12. "-std=c99",
  13. ],
  14. })
  15. # This library is for internal hiredis use, because hiredis assumes a
  16. # different include prefix for itself than external libraries do.
  17. cc_library(
  18. name = "_hiredis",
  19. hdrs = [
  20. "dict.c",
  21. ],
  22. copts = COPTS,
  23. )
  24. cc_library(
  25. name = "hiredis",
  26. srcs = glob(
  27. [
  28. "*.c",
  29. "*.h",
  30. ],
  31. exclude =
  32. [
  33. "ssl.c",
  34. "test.c",
  35. ],
  36. ),
  37. hdrs = glob([
  38. "*.h",
  39. "adapters/*.h",
  40. ]),
  41. copts = COPTS,
  42. include_prefix = "hiredis",
  43. deps = [
  44. ":_hiredis",
  45. ],
  46. visibility = ["//visibility:public"],
  47. )