BUILD 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. # Description:
  2. # Brotli is a generic-purpose lossless compression algorithm.
  3. package(
  4. default_visibility = ["//visibility:public"],
  5. )
  6. licenses(["notice"]) # MIT
  7. STRICT_C_OPTIONS = [
  8. "--pedantic-errors",
  9. "-Wall",
  10. "-Wconversion",
  11. "-Werror",
  12. "-Wextra",
  13. "-Wlong-long",
  14. "-Wmissing-declarations",
  15. "-Wmissing-prototypes",
  16. "-Wno-strict-aliasing",
  17. "-Wshadow",
  18. "-Wsign-compare",
  19. ]
  20. filegroup(
  21. name = "common_headers",
  22. srcs = glob(["common/*.h"]),
  23. )
  24. filegroup(
  25. name = "common_sources",
  26. srcs = glob(["common/*.c"]),
  27. )
  28. filegroup(
  29. name = "dec_headers",
  30. srcs = glob(["dec/*.h"]),
  31. )
  32. filegroup(
  33. name = "dec_sources",
  34. srcs = glob(["dec/*.c"]),
  35. )
  36. filegroup(
  37. name = "enc_headers",
  38. srcs = glob(["enc/*.h"]),
  39. )
  40. filegroup(
  41. name = "enc_sources",
  42. srcs = glob(["enc/*.c"]),
  43. )
  44. cc_library(
  45. name = "brotli_common",
  46. srcs = [":common_sources"],
  47. hdrs = [":common_headers"],
  48. copts = STRICT_C_OPTIONS,
  49. )
  50. cc_library(
  51. name = "brotli_dec",
  52. srcs = [":dec_sources"],
  53. hdrs = [":dec_headers"],
  54. copts = STRICT_C_OPTIONS,
  55. deps = [
  56. ":brotli_common",
  57. ],
  58. )
  59. cc_library(
  60. name = "brotli_enc",
  61. srcs = [":enc_sources"],
  62. hdrs = [":enc_headers"],
  63. copts = STRICT_C_OPTIONS,
  64. deps = [
  65. ":brotli_common",
  66. ],
  67. )
  68. cc_binary(
  69. name = "bro",
  70. srcs = ["tools/bro.c"],
  71. copts = STRICT_C_OPTIONS,
  72. linkstatic = 1,
  73. deps = [
  74. ":brotli_dec",
  75. ":brotli_enc",
  76. ],
  77. )