BUILD.original 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. # Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. # Exceptions. See /LICENSE for license information.
  3. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. # Rules are adapted from CMakeLists.txt.
  5. load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test")
  6. package(
  7. default_visibility = ["//visibility:public"],
  8. )
  9. # Common part used by decoder and encoder
  10. cc_library(
  11. name = "woff2common",
  12. srcs = [
  13. "src/table_tags.cc",
  14. "src/variable_length.cc",
  15. "src/woff2_common.cc",
  16. ],
  17. hdrs = [
  18. "src/buffer.h",
  19. "src/file.h",
  20. "src/port.h",
  21. "src/round.h",
  22. "src/store_bytes.h",
  23. "src/table_tags.h",
  24. "src/variable_length.h",
  25. "src/woff2_common.h",
  26. ],
  27. strip_include_prefix = "src/",
  28. )
  29. # WOFF2 Decoder
  30. cc_library(
  31. name = "woff2dec",
  32. srcs = [
  33. "src/woff2_dec.cc",
  34. "src/woff2_out.cc",
  35. ],
  36. hdrs = [
  37. "include/woff2/decode.h",
  38. "include/woff2/output.h",
  39. ],
  40. copts = [
  41. "-Wno-unused-variable",
  42. "-Wno-unused-const-variable",
  43. ],
  44. strip_include_prefix = "include/",
  45. deps = [
  46. ":woff2common",
  47. "@brotli//:brotlidec",
  48. ],
  49. )
  50. cc_binary(
  51. name = "woff2_decompress",
  52. srcs = ["src/woff2_decompress.cc"],
  53. deps = [":woff2dec"],
  54. )
  55. # WOFF2 Encoder
  56. cc_library(
  57. name = "woff2enc",
  58. srcs = [
  59. "src/font.cc",
  60. "src/font.h",
  61. "src/glyph.cc",
  62. "src/glyph.h",
  63. "src/normalize.cc",
  64. "src/normalize.h",
  65. "src/transform.cc",
  66. "src/transform.h",
  67. "src/woff2_enc.cc",
  68. ],
  69. hdrs = [
  70. "include/woff2/encode.h",
  71. ],
  72. copts = [
  73. "-Wno-unused-variable",
  74. "-Wno-unused-const-variable",
  75. "-Wno-sign-compare",
  76. ],
  77. strip_include_prefix = "include/",
  78. deps = [
  79. ":woff2common",
  80. "@brotli//:brotlienc",
  81. ],
  82. )
  83. cc_binary(
  84. name = "woff2_compress",
  85. srcs = ["src/woff2_compress.cc"],
  86. deps = [":woff2enc"],
  87. )
  88. # WOFF2 info
  89. cc_binary(
  90. name = "woff2_info",
  91. srcs = [
  92. "src/font.h",
  93. "src/woff2_info.cc",
  94. ],
  95. copts = ["-Wno-sign-compare"],
  96. deps = [":woff2common"],
  97. )